#node build/server/index.js does nothing

1 messages · Page 1 of 1 (latest)

modest jewel
#

I am trying the new RR7 with the default vite install and I already did npm run build and in the build folder there is client and server and in server there is assets folder and index.js file.
But if I try to run it without vite directly using just node like 'node build/server/index.js or node ./build/server/index.js while being in the root of the folder this is what will happen:

#

npx react-router-serve build/server/index.js is working. But why can't I run it with node directly?

deep umbra
modest jewel
#

And if I want to run it on my server?

#

let's say via PM2

deep umbra
#

just put a scripts.. don't use npx

#

on your package.json

modest jewel
#

I mean, I want it for frontend client app but also rendering. But the API is golang.

#

I would just do a full spa thing but I need ssr for seo so that's why I want to find out a setup with just node or something that will run via PM2

deep umbra
#

oh,. then don't use ssr..

modest jewel
#

For this project I need ssr

deep umbra
#

Loader will not work on ssr,.

modest jewel
#

For others I don't

deep umbra
#

you can just call the api via fetch?

modest jewel
#

man, it's so complicated 😉

#

yes, just 100% api calls to a different server

#

including auth etc.
The only issue is that I need for this project ssr. It's not behind an auth and will be very public and "sharable" via social networks, search engine indexing bots, etc.

deep umbra
#

it's too complicated if it's full spa,.

modest jewel
#

Think Laravel Inertia with SSR but I want to detach them completely.

deep umbra
#

react-router-serve only used when you enabled ssr,.

modest jewel
#

yes.

#

that's what I want

#

ssr

#

to generate html on the server

#

on the fly

#

dynamically

#

Maybe my only choice is Angular + NestJS 😉

#

I thought RR7 can do that easily but it's probably a lot of work.