express-live

1.0.1 • Public • Published

EXPRESS LIVE

Live reload for Express template engines.

Installation

  • Install express-live with npm
npm install express-live

Install vscode live server

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))

Dependents (0)

Package Sidebar

Install

npm i express-live

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

5.46 kB

Total Files

5

Last publish

Collaborators

  • madhanmaaz