xbisa
Angular SSR
I'm planning to deploy an angular app with server side rendering. Does Railway support it?
At the moment the rendering is in the browser. I have build and start scripts in my package json that looks like this
"build": "ng build --configuration $NODE_ENV",
"start": "serve dist/app-name -s -n -L -p $PORT",
but with server side rendering it's a bit different
"serve:ssr": "node dist/app-name/server/main.js",
According to Angular docs: Starts the server script for serving the application locally with server-side rendering. It uses the build artifacts created by npm run build:ssr, so make sure you have run that command as well. serve:ssr is not intended to be used to serve your application in production, but only for testing the server-side rendered application locally.
"build:ssr": "ng build && ng run app-name:server",
According to Angular docs: Builds both the server script and the application in production mode. Use this command when you want to build the project for deployment.
i have different environments on Railway and I want to build for them, so I can modify "build:ssr": "ng build && ng run app-name:server" to "build:ssr": "ng build --configuration $NODE_ENV && ng run app-name:server". And perhaps I can substitute
"build": "ng build --configuration $NODE_ENV" with "build": "ng build --configuration $NODE_ENV && ng run app-name:server".
But I'm a little bit doubtful about how I should modify the start script. Could this work:
"start": "node dist/app-name/server/main.js -s -n -L -p $PORT" ?
14 replies
DNS trouble
I added a custom domain to a service, an angular app. I talked to my domain provider in DK, and they told me that they cannot create CNAMES on the main domain, it has to be a IP pointer in the form of an A-record instead.
What to do?
29 replies
Error: read ECONNRESET at TCP.onStreamRead
Now and then I get the exception below. I have to make the same request 3 times before I get a response from my NestJS API app.
[Nest] 32 - 08/03/2023, 8:08:30 AM ERROR [ExceptionsHandler] select * from "municipalities" order by "name" asc - read ECONNRESET
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
Connection Error: Connection ended unexpectedly
The above log is from NestJS API log. Can someone point me in the right direction?
48 replies