Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.22 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.22 KB

express-hot-reload-dev Build Status npm

hot reload for express

how to use

demo 0 | demo 1

import exp from 'express';
import { hotReload } from 'express-hot-reload-dev';

const app = exp();

const hotReloadMiddle = hotReload(`${__dirname}`, false);

const routePaths = [
  '/routes/router01'
];

for (const item of routePaths) {
  const routePath = `${__dirname}${item}`;
  app.use(hotReloadMiddle(routePath));
}

app.listen(3000, ()=>{
  console.log('Listening on 3000');
}); 

workspace

docker run --rm -it \
  -w /app \
  -v $(pwd):/app \
  -p 9000:9000 \
  node:12.14-alpine /bin/sh

run test

npm i
npm run test

references

other issues