nuejs / create-nue

A recommended way to start a Nue project
https://nuejs.org
139 stars 30 forks source link

Exiting Windows HTTP server gracefully #3

Open nerbl opened 1 year ago

nerbl commented 1 year ago

There's one file in node_modules that has a .cmd extension, js-yaml.cmd, which I believe makes npm run start always ask Terminate batch job (Y/N)? when pressing Ctrl+C to stop the server.

This question is asked twice, and the server stops regardless of whether you answer Y or N.

I tried catching SIGINT in server.js but nothing I tried will change the behavior. According to a StackOverflow discussion there are solutions (yarn, .ps1) but I don't know currently how to implement them and should get back to work.

To be clear, this has a nearly minimal effect on usability and possibly originates from a dependency (aka not your problem)