-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
38 lines (30 loc) · 1.21 KB
/
app.js
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
var express = require('express');
var path = require('path');
var expressHBs = require('express-handlebars');
var app = express();
var port = process.env.PORT || 3000;
var deckIDs = {"DECK 1": ["leftPlayer", "leftDeckTable", "leftDeckUpload", "playButtonL", "VolSliderL", "waveformL", "canvasLeft", "graphLeft", "LPLeft", "BPLeft", "HPLeft"], "DECK 2": ["rightPlayer", "rightDeckTable", "rightDeckUpload", "playButtonR", "VolSliderR", "waveformR", "canvasRight", "graphRight", "LPRight", "BPRight", "HPRight"] };
app.use('/static', express.static(__dirname + '/static'));
app.set('port', port)
app.engine('.hbs', expressHBs({
defaultLayout: 'main',
extname: '.hbs',
layoutsDir: path.join(__dirname, 'views/layouts/')
}))
app.set('view engine', '.hbs');
app.set('views', path.join(__dirname, 'views'));
app.get('/', (request, response) => {
response.render(path.join(__dirname, 'views/layouts/main'), {
audio: 'static/audio.js',
tests: 'static/tests.js',
worker: 'static/work.js',
analyzer: 'static/analysisModule.js',
deckIDs: deckIDs
})
})
app.listen(port, (err) => {
if (err) {
return console.log('Error: ', err);
}
console.log('Server is listening on port: ', port);
});