http-party / http-server

a simple zero-configuration command-line http server
MIT License
13.42k stars 1.48k forks source link

Add graceful shutdown and error handling #779

Open Octalbyte opened 2 years ago

Octalbyte commented 2 years ago

This PR adds handling for fatal crashes of any type. Just so you don't have to see a giant error stack on your console.
The feature is turned on by the --no-panic option or by the environment variable NODE_HTTP_SERVER_NO_PANIC. The output is something like: image

Relevant issues

Refers partly to #665

What needs to be done:
Contributor checklist
Maintainer checklist
Octalbyte commented 2 years ago

Ready for review.