#Angular 17 SSR does not use server.ts when running ng serve

4 messages · Page 1 of 1 (latest)

rigid zephyr
#

I'm trying to use ssr with my newest angular 17 app.

So I added @angular/ssr and updates the /server.ts to send a response on /api
When I run ng serve as described in the documentation, the server.ts file is not used.
I've added logs to verify.

Now I'm wondering how to implement an api with nestjs e.g. when the server file is not used.
What I found out so far is, that the bootstrap function is called from vite with the instantiateModule function

scenic snow
#

You need to build the app in development mode with watch flag enabled and in separate terminal, run server file from dist folder using node

rigid zephyr
#

yeah, that's what I thought. Thanks

rigid zephyr
#

And how should I add e.g. nest for the production build to the server.ts?
AFAIK I need to build nest before importing