-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (26 loc) · 701 Bytes
/
Copy pathserver.js
File metadata and controls
32 lines (26 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This file boot up the application
// Tell the application to use routes.js
const { createServer } = require('http');
const next = require('next');
const app = next({
dev: process.env.NODE_ENV !== 'production',
conf: {
webpack: config => {
config.devtool = false;
for (const r of config.module.rules) {
if (r.loader === 'babel-loader') {
r.options.sourceMaps = false;
}
}
return config;
}
}
});
const routes = require('./routes');
const handler = routes.getRequestHandler(app);
app.prepare().then(() => {
createServer(handler).listen(3000, err => {
if (err) throw err;
console.log('Ready on localhost:3000');
});
});