forked from simap/Firestorm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
34 lines (24 loc) · 679 Bytes
/
server.js
File metadata and controls
34 lines (24 loc) · 679 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
33
const discovery = require('./app/discovery');
const express = require('express')
const app = express()
const bodyParser = require('body-parser');
const compression = require('compression');
const repl = require('repl');
discovery.start({
host: '0.0.0.0',
port: 1889
});
app.use(bodyParser.json());
const {PORT = 80} = process.env
require("./app/api")(app);
app.use(compression())
app.use(express.static('build'));
console.log('listening on %s', PORT)
app.listen(PORT)
const r = repl.start('> ');
r.on('exit', () => {
console.log('Received "exit" event from repl!');
process.exit();
});
r.context.discoveries = discovery.discoveries;
r.context.reqire = require;