-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
25 lines (21 loc) · 712 Bytes
/
server.js
File metadata and controls
25 lines (21 loc) · 712 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
/* eslint-disable @typescript-eslint/no-var-requires */
const express = require('express');
const next = require('next');
// const i18nMiddleware = require('next-translate/i18nMiddleware').default;
// const i18nConfig = require('./i18n');
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
const server = express();
const PORT = parseInt(process.env.PORT, 10) || 8000;
// server.use(i18nMiddleware(i18nConfig));
server.get('*', handle);
module.exports = app
.prepare()
.then(() =>
server.listen(PORT, (err) => {
if (err) throw err;
console.log(`> Ready on http://localhost:${PORT}`);
}),
)
.catch(console.error);