Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Hapi auto reload app during developing

Tags:

node.js

hapijs

I'm new to *Hapi *framework. During development, I have to restart the hapi server whenever I made any changes to the code.

For the view part, I can add an option {isCached: false}to make the view read the latest html file every time. However, is there an easy setting to make it reload code automatically whenever it is changed?

UPDATE:

Thanks to dylants' suggestion, Nodemon works great.

However, in my app there is a selenium-standalone child process, whenever the nodemon restarts, it will generate an error log. ...Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again...

I have tried https://github.com/remy/nodemon#controlling-shutdown-of-your-script, it doesn't help.

like image 409
snowery Avatar asked Oct 29 '14 01:10

snowery


Video Answer


1 Answers

I've used nodemon. You just start your server with $ nodemon instead of $ npm start and every time you make a change to your server code it restarts the server.

like image 129
Catfish Avatar answered Nov 15 '22 22:11

Catfish