forked from edulutionzm/offline_testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·39 lines (32 loc) · 1.08 KB
/
index.js
File metadata and controls
executable file
·39 lines (32 loc) · 1.08 KB
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
34
35
36
37
38
39
const express = require('express')
const app = express()
const path = require('path')
/*Port the server will run on*/
const port = 8888
/*Use bodyParser to parse form data*/
const bodyParser = require('body-parser')
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }))
/*Serve static assets from the public folder*/
global.__basedir = __dirname;
app.use(express.static(path.join(__dirname, 'public')))
/*Import all of the route modules*/
const portal = require('./routes/portal')
const api = require('./routes/api')
const playlists = require('./routes/playlists')
const numeracy = require('./routes/numeracy')
const literacy = require('./routes/literacy')
const grade7 = require('./routes/grade7')
app.use('/', portal)
app.use('/api', api)
app.use('/playlists', playlists)
app.use('/numeracy', numeracy)
app.use('/literacy', literacy)
app.use('/grade7', grade7)
/*Results dashboard page*/
app.get('/coach', (req, res) => {
res.sendFile(__dirname + '/dashboard/index.html')
})
app.listen(port, '0.0.0.0', () => {
console.log('Server running on port ' + port)
})