Reputation: 1
I have angular at frontend with node at backend and I need to run both on a windows server. The Angular I am able to host using URL rewrite in IIS but am confused about what to do with nodejs code? Am I supposed to start nodejs code via cmd and then Angular on IIS? Also how should i keep the mongod.exe started while i host? I want to know how to host everything on production server.
Upvotes: 0
Views: 330
Reputation: 819
Your Angular approach is okay. If rewrite works, be happy.
For NodeJS project, if you launch npm run start
(or whatever script you use), Windows' CMD (or PowerShell), at least on Windows Server, when you logout from your session usually blocks/freezes the console, so you literally got nothing.
Now, to solve it, PM2 tool is your friend ( https://pm2.keymetrics.io/ ). Follow their docs, it's super easy to configure and run.
I'm not an user of mongo. I'd say you'll need a service to keep it always running.
(edit) I found this question here: How do I start Mongo DB from Windows?
Upvotes: 1