node-express-reload
Reload application server (hosting and cloud), kill process and install NPM packages online
- Helps to refresh your application after changes
- Automaticly reload your express.js server without bringing down the server
- Reload server
- Kill process
- Kill port
- List pid processes
- List, fix and audit packages
- Install new packages (get method)
WARNING: Do not use the development server in a production environment.
Install
npm install node-express-reload
Example 1 (reloaded manually)
view code example
const express = require("express");
const app = express();
const PORT = 8080;
app.use('/ner', require("node-express-reload")({
username: 'admin',
password: 'NeR777#',
serverfile: __filename,
}));
app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);
Example 2 (without bringing down the server)
view code example
Silent reload module (express router)
const express = require("express");
const app = express();
const requireWatcher = require("node-express-reload")('require-watcher');
const PORT = 8080;
app.use('/home', requireWatcher( __dirname + '/home/index.js'))
app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);
Example 3 (watcher files)
view code example
const express = require("express");
const app = express();
const PORT = 8080;
app.use('/ner', require("node-express-reload")({
serverfile: __filename,
watcher: ['.'],
depth: 10,
}));
app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);
Another resource to management
Screens
GET Method
GET http://localhost:8080/ner/reload/
GET http://localhost:8080/ner/kill/
GET http://localhost:8080/ner/kill/PID (pid is a number)
GET http://localhost:8080/ner/npm/i/pdfkit-table,cors
Actions
Options
Soon.
License
The MIT License.
Author
Thank you