hot reload for express
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');
});
docker run --rm -it \
-w /app \
-v $(pwd):/app \
-p 9000:9000 \
node:12.14-alpine /bin/sh
npm i
npm run test