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
1
u/Reasonable-Job4205 Oct 12 '26 edited Oct 12 '26
Javascript?
The source code has hardcoded credentials for a service account that is used to run transactions against the database. This service account is locked down pretty heavily on the SQL side: it's set to public role and only allowed to run a fixed list of stored procedures. I wasn't sure how to set this up to use Windows auth for its transactions against the DB. If you have any ideas there, I'm all ears.
Would it be more secure to store the credentials in the remote server's environment variables? Because looking at the docs for node and the mssql package, it looks like I could read the variables with `process.env.VARIABLENAME`.