Merge SSR with already running node.js backend on Heroku #10820
-
|
Hello there, I have a Quasar App (SPA) and a Node.js/Express/Mongo backend which is running well on my Heroku... For SEO I want to change my SPA to SSR.. I convert my app to SSR. On my local, first I start the SSR and then start backend Node.js server and everything seems fine.. (So I am using 2 servers at a time) however, on heroic I couldn't do that cause two servers start to listen the same port and it crashes ( Heroku doesn't allow you to give custom ports) I tried to import my SSR Node codes to my backend codes (Server/App.js) but I couldn't figure it out :( I don't know if it is possible.. Current setup is similar to this; //UI //API routes Is it possible? if so, how could I do that? if it is not, do I need to setup 2 different dynos on Heroku one for the SSR one for the backend? Is there any example? Thanks.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
if u're using Quasar V2, u can use SSR middlewares to integrate your backend to your frontend: Some time ago i created a repo with "Yarn Workspaces + Quasar + NestJS + TS" here the important points: |
Beta Was this translation helpful? Give feedback.
if u're using Quasar V2, u can use SSR middlewares to integrate your backend to your frontend:
Some time ago i created a repo with "Yarn Workspaces + Quasar + NestJS + TS"
https://github.com/TobyMosque/ws-quasar-nest
here the important points:
frontend/ssr/middlewares/render.js#L8
backend/src/index.ts#L8