Understanding the deployment of a SolidJS app (with a separate backend)
I hope this doesn’t go too off topic because this is more of a general question but I am trying to understand what are my options for deploying an application made with SolidJS for the frontend and, for example, Golang for the backend.
Let’s say I want to deploy my web app to Heroku. From what I understand I have three options:
1. Building the SolidJS app and creating a NodeJS server (e.g. with Express) that serves the static files. With that, I would need to host my backend as one server and my frontend another. The frontend would call the backend from a different domain and to make that work I would need to set up the CORS policy. Maybe for that option it would be better to deploy the frontend to Netlify.
2. Building the SolidJS app and serving it using the Golang backend itself. So both the frontend and backend would live in the same server and domain (e.g. ‘www.myapp.com’ for the frontend and ’www.myapp.com/api' for the backend API routes).
3. Dockerizing the app and deploying it as a “Container Registry” in Heroku. But I suppose this option would require me to do the same of either option one or two (most likely option one where I would have my frontend as one service/container and my backend as another).
I suppose the second option would be the best for me considering my backend API is only used by my frontend and I want to prioritize low costs but I wanted to know what is your experience and what do you guys think would be optimal! Also, let me know if you have suggestions for hosting plataforms other than Heroku where I could use a free tier (I am using student credit on Heroku for now).
2 Replies
do you want ssr?
if not
then your website is just static files
better to serve them from a cdn like netlify instead of a central server
same if you want to use ssr I guess, because you’re locked to node so you cannot just use your go backend
but yeah
cors
is that an issue to enable it?
No SSR!
Oh nice to know, I think I would go with that option than