-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (22 loc) · 798 Bytes
/
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
#!/usr/bin/env nodejs
const express = require('express');
const twig = require('twig');
const bodyParser = require('body-parser');
const app = express();
const webRoutes = require('./src/routes/web/index');
app.set("twig options", {
allow_async: false, // Allow asynchronous compiling
strict_variables: false
});
app.set('views', __dirname + '/src/views');
app.engine('html', twig.__express);
app.set('view cache', false);
app.use('/', webRoutes);
app.use(express.static('public'));
app.use('/node_modules', express.static(__dirname + '/node_modules'));
app.use('/views', express.static(__dirname + '/src/views'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.listen(8080,function(){
console.log("Audio Visualiser: Run at Port 8080");
});