-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (23 loc) · 779 Bytes
/
Copy pathindex.js
File metadata and controls
39 lines (23 loc) · 779 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
38
var express = require('express'),
exphbs = require('express-handlebars');
router = express.Router();
var chalk = require('chalk');
var app = express();
var startArgs = process.argv.slice(2);
app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');
/*----------- STATIC -----------*/
app.use(express.static(__dirname + '/static'));
/*----------- ROUTES -----------*/
router.use(function(req, res, next) {
console.log("Request: " + req.method, req.url);
next();
});
router.get('/', function (req, res) {
res.render('home');
});
app.use('/', router);
// port 37605
app.listen(startArgs[0]);
console.log(chalk.inverse('\n Starting TRANSLATE! on port ' + startArgs[0] + '. \n'));
/* ---------- FUNCTIONS --------- */