forked from shippableSamples/sample_node_eb_paas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
20 lines (17 loc) · 635 Bytes
/
server.js
File metadata and controls
20 lines (17 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var express = require("express"),
nano = require('nano')('http://localhost:5984'),
app = express();
var favicon = require('serve-favicon');
app.use(favicon('public/resources/images/nodejs.ico'));
app.engine('html', require('ejs').renderFile);
app.use(express.static(__dirname + '/public'));
app.set('view engine', 'html');
app.get("/public/*", function (req, res) {
res.sendFile(__dirname + req.originalUrl );
});
app.get("/", function (req, res) {
res.render("/public/index.html");
});
app.listen(process.env.PORT || 3000 , function () {
console.log('Express listening on port ' + process.env.PORT + ' or 3000');
});