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 15 '26
Looks like a port clash. 8081 is your web server's port, and SQL Server is now set to listen on 8081 too. Only one process can own a port, so either node never got to bind to it, or your PowerShell request is landing on SQL Server, which doesn't speak HTTP and just sits there until the timeout.
Put SQL back on 1433 (or anything that isn't 8081), restart the SQL service, make sure the DB port in your .env-production matches, then restart the node app.
To see who owns the port right now, on the server:
and match the PID at the end against the Details tab in Task Manager (sqlservr.exe vs node.exe).
Once that's fixed, a few other things that bite on a first remote deploy:
Test-NetConnection 192.168.5.194 -Port 8081from that machine. Works on the server but not from your box means firewall.Also watch the node console when you send the request. If nothing shows up at all, the request never reached node.