-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
37 lines (27 loc) · 769 Bytes
/
server.js
File metadata and controls
37 lines (27 loc) · 769 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
31
32
33
34
35
36
37
/* enviroment */
var port = process.env.PORT || 4242
/* requires */
var express = require("express");
var app = express.createServer();
var routes = require("./routes/routes.js");
/* configs */
app.configure(function(){
app.use(express.static(__dirname+"/public"));
app.set('views', __dirname+'/views');
app.set('view engine', 'ejs');
app.set('view options', {
layout : false
});
});
/* CRUD */
app.get('/favicon.ico', function(req, res){
return null;
});
app.get('/parseVideoPath', routes.parseVideoPath);
app.get('/parseUrl', routes.parseUrl);
app.get('/getCaptions', routes.getCaptions);
app.get('/:videoPath', routes.videoView);
app.get('/', routes.indexView);
/* start 'er up */
app.listen(port);
console.log("server has started on port "+port);