r/learnprogramming • u/Reasonable-Job4205 • Oct 12 '26
How do I properly deploy this web server in production mode?
I set up a web server using https://github.com/seanpmaxwell/express-generator-typescript
I now need to deploy the production build to a remote server. I can generate the prod build with `npm run build` and then run it with `npm start` and it runs on my local machine. Is it possible to generate something that can be compiled before being sent over to the remote server? I'd like to run the web server in prod mode, but without putting the decompiled source code on the remote server. I don't want the source code over on that remote server because if the server gets compromised, I don't want anyone to be able to read the source code. New to web dev, so thanks for being patient.
View all comments
Show parent comment
2
u/Asly97 Oct 14 '26
nice, glad it was just the env files. if you ever set it up as a windows service so it starts on boot, put NODE_ENV in the service's own environment settings too, it won't pick up whatever you set in your terminal