express-live
v1.0.1
Published
Live reload for Express template engines.
Downloads
4
Maintainers
Readme
EXPRESS LIVE
Live reload for Express template engines.
Installation
- Install express-live with npm
npm install express-live
Install vscode live server
- Install Live Server
- Start the live server on vscode
express-live Usage
const express = require('express');
const app = express();
// express-live
app.use(require("express-live")())
// ejs
app.set("view engine", "ejs")
app.get('/', (req, res) => {
res.render('index', { data: 1 });
})
// Start the server
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
})
- use different host and port.
// the default host: 127.0.0.1 & port: 5500
app.use(require("express-live")('127.0.0.1', 8080))