-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
25 lines (19 loc) · 834 Bytes
/
server.js
File metadata and controls
25 lines (19 loc) · 834 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
var express = require('express');
var app = express();
var anyDB = require('any-db');
var conn = anyDB.createConnection('sqlite3://chatroom.db');
var engines = require('consolidate');
var colors = require('colors');
var moment = require('moment');
app.engine('html', engines.hogan); // tell Express to run .html files through Hogan
app.set('views', __dirname + '/now-playing'); // tell Express where to find templates
app.use(express.bodyParser()); // definitely use this feature
app.use(express.static(__dirname));
conn.query('CREATE TABLE IF NOT EXISTS tracks (id INTEGER PRIMARY KEY AUTOINCREMENT, user TEXT, mobname TEXT, trackid TEXT);');
app.post('/', function(request, response){
});
app.get('/', function(request, response){
response.render("index.html");
});
var port = process.env.PORT || 8080;
app.listen(port);