Restarting server on changes
See original GitHub issueDescription
Is there anyway to start/ stop/ restart the server during test?
Expected outcome
to start separate server to run jasmine tests then stop the server after test complete
Actual outcome
Not sure how to stop server other than usual CTRL + C
command
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Automatically Restart Node Apps on File Change with nodemon
In this short tutorial, learn how to restart Node/JavaScript applications automatically when you change a source file with Nodemon.
Read more >Is a server reboot a change - ITILfromExperience.com
A reboot does not change the configuration of the service or the attributes of the configuration items thus, it is not a change...
Read more >When the test server requires restarting - IBM
If you change the server or the server configuration while the server is running, for example, if you change the port number, you...
Read more >Configuration Changes Requiring Server Restart
If a property has an rws (read, write, static) keyword, the server must be restarted when the property is changed. If a property...
Read more >Automatically restart Node.js apps with Nodemon
The essential tutorial for Nodemon, a utility for Node.js applications that monitors for changes and automatically restarts the server.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I had big plans for Server.js (large overhauls, big plugin system) but then started working fulltime in a demanding job so now it’s in maintenance[1]. Everything there should work, but I’m not rewriting/making large changes to it for the time being. I still do some experiments from time to time.
One large issue with server.js is that I never thought too well is how devs would test their apps running this library. I’ve since learned and in my recent projects I even include examples for testing.
Another thing is that, when I eventually build server.js 1.1 or 2.0, I want the APIs to be mostly backwards compatible (even if 2.0 implies breaking changes, I’m trying to minimize those). So any API that I’m not completely sure, I think it’s best not to have it officially supported.
So yeah, you can definitely use
server().then(ctx => ctx.close())
if you want; I’m using it in fact, but I’m not comfortable making that single function official until there’s a whole story on testing. In fact, there are two large parts that are unfinished, one is testing and another is error handling (or better said, the documentation about error handling):That said, I just added a small note in Advanced Topics about
server().then(app => app.close())
(and named itapp
to avoid confusing it with the normal middleware context).[1] The main reason, while I’ve been doing other projects, is scale. Server.js (along with probably Picnic CSS) is probably the largest and most complex project I’ve built. To do small but important new features/changes it takes dozens of hours (I am very strict on not breaking things in this project), which I still do (see the new
head()
method), and to give the love the project needs to be 1st class it’d require few months of full time work IMHO. I simply don’t have that time/energy right now, I hope to have it in the future but as right now I’m just doing my best to maintain the project.What’s the status on this one?
I just discovered server.js and immediately loved the elegant, minimal API - looks perfect for testing on my project, and frankly I’d prefer not to mess around with
express
, either by itself, or by breaking into the implementation details of server.js.I looked everywhere in the manual for some way to stop a server - but
context.close()
remains undocumented 3 years later?There is a list of useful issues and caveats in this issue - these would make good work items… and the issue doesn’t appear to have been (officially) resolved, so I would suggest to reopen this, if you wouldn’t mind?