-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (21 loc) · 711 Bytes
/
index.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
var express = require("express");
var app = express();
// template engine
var hbs = require('hbs');
// Apply authentication to server.
// Username: Bane, Password: rip
//app.use(express.basicAuth('Bane', 'rip'));
app.use(express.static(__dirname));
app.engine('html', require('hbs').__express);
app.set('views', __dirname + '/');
app.set('view engine', 'html');
app.get('/', function(req, res) {
res.render('index.html');
// permanent redirect
//res.redirect(301, "https://yoursite.com");
});
// spin up server (appfog)
//app.listen(process.env.VMC_APP_PORT || 8080, null);
// spin up server (azure or other)
app.listen(process.env.PORT || 8080, null);
console.log('server running on port 8080');