Lister
Banned
Hey guys, hoping someone can help me out. Im helping out superepicman. We're using a mean stack for our project, and while I know angular well, I'm new to node js and express. Hoping this project is a learning experience for me as I'm more of a dot net guy.
Anyway, the issue I'm having right now is that I can't kill my express server (we're running mongoose for our mongodb odm) after starting it if im calling it alongside a typescript transpile call. Making working on it tedious as hell.
Our package.json script is the following:
If I enter npm run server, everything works as expected. Typescript compiles, server starts listening, BUT if I hit ctrl + c the server keeps on running in the background. It still answers requests, and if I try to run npm run server again I get the expected, port is already in use error. I have to then go to task manager and kill all node.js processes to restart.
The weird thing is that if I instead type both commands separately, first tsc -p tsconfig-server.json and THEN node bin/server/server.js, ctrl + c works in killing the server properly. This weird behavior is killing my mojo!
I'm on windows 10 running these commands on a gitbash command prompt. This is also a more simplified setup after noticing this issue, as I had everything setup to watch for ts file changes for reloading the node server app while developing.
Any help would be appreciated. Can also share our repo address if need be. On mobile right now so will add tomorrow.
Anyway, the issue I'm having right now is that I can't kill my express server (we're running mongoose for our mongodb odm) after starting it if im calling it alongside a typescript transpile call. Making working on it tedious as hell.
Our package.json script is the following:
Code:
server: "tsc -p tsconfig-server.json && node bin/server/server.js"
If I enter npm run server, everything works as expected. Typescript compiles, server starts listening, BUT if I hit ctrl + c the server keeps on running in the background. It still answers requests, and if I try to run npm run server again I get the expected, port is already in use error. I have to then go to task manager and kill all node.js processes to restart.
The weird thing is that if I instead type both commands separately, first tsc -p tsconfig-server.json and THEN node bin/server/server.js, ctrl + c works in killing the server properly. This weird behavior is killing my mojo!
I'm on windows 10 running these commands on a gitbash command prompt. This is also a more simplified setup after noticing this issue, as I had everything setup to watch for ts file changes for reloading the node server app while developing.
Any help would be appreciated. Can also share our repo address if need be. On mobile right now so will add tomorrow.