app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404); } else { res.send(file.toString()); } }); });
// For Develooment init const addDevMiddlewares = (app, webpackConfig) => { const webpack = require('webpack') const webpackDevMiddleware = require('webpack-dev-middleware') const webpackHotMiddleware = require('webpack-hot-middleware') const compiler = webpack(webpackConfig) const middleware = webpackDevMiddleware(compiler, { noInfo: true, publicPath: webpackConfig.output.publicPath, silent: true, stats: 'errors-only' }) app.use(middleware) app.use(webpackHotMiddleware(compiler)) const fs = middleware.fileSystem app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404) } else { res.send(file.toString()) } }) }) logger.info('>>APP<< Complete init App and Routes for Un-production') }
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404);
app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404); } else { res.send(file.toString()); } }); });
app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404); } else { res.send(file.toString()); } }); });
app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404); } else { res.send(file.toString()); } }); });
app.get('*', (req, res) => { fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404); } else { res.send(file.toString()); } }); });
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404);
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404);
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => { if (err) { res.sendStatus(404);