-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathvoltah.js
More file actions
29 lines (27 loc) · 791 Bytes
/
voltah.js
File metadata and controls
29 lines (27 loc) · 791 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
const express = require('express');
const app = express();
__path = process.cwd()
const bodyParser = require("body-parser");
const PORT = process.env.PORT || 5000;
let server = require('./qr'),
code = require('./pair');
require('events').EventEmitter.defaultMaxListeners = 500;
app.use('/scan', server);
app.use('/code', code);
app.use('/qr', async (req, res) => {
res.sendFile(__path + '/qr.html')
})
app.use('/pair', async (req, res) => {
res.sendFile(__path + '/pair.html')
})
app.use('/', async (req, res) => {
res.sendFile(__path + '/main.html')
})
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.listen(PORT, () => {
console.log(`
Don't Forget To Give Star
Server running on http://localhost:` + PORT)
})
module.exports = app