-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (24 loc) · 832 Bytes
/
server.js
File metadata and controls
30 lines (24 loc) · 832 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
const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const app = express()
const port = 3100
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use('/css', express.static('css'));
app.listen(port, () => console.log(`Example app listening on port ${port}`))
app.get('/', (req,res) => {
res.sendFile(path.resolve('index.html'));
})
app.get('/js/coderbunkerusers.json', (req,res) => {
res.sendFile(path.resolve('js/coderbunkerusers.json'));
})
app.get('/js/index.js', (req,res) => {
res.sendFile(path.resolve('js/index.js'));
})
app.get('/config.json', (req,res) => {
res.sendFile(path.resolve('config.json'));
})
app.get('/libs/elasticlunr.min.js', (req,res) => {
res.sendFile(path.resolve('libs/elasticlunr.min.js'));
})