-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (18 loc) · 625 Bytes
/
Copy pathapp.js
File metadata and controls
24 lines (18 loc) · 625 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
const express = require('express');
const http = require('http');
const path = require('path');
const cookieParser = require('cookie-parser');
const streamEnabler = require('./stream');
const port = process.env.PORT || 3000
const indexRouter = require('./routes/index');
const app = express();
const server = http.Server(app);
const stream = streamEnabler(server);
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
server.listen(port, () => {
console.log('Listening on', port);
});