forked from pepyatka/pepyatka-html
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (18 loc) · 645 Bytes
/
index.js
File metadata and controls
23 lines (18 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";
var express = require('express')
, app = express()
, http = require('http')
, path = require('path')
app.set('port', 3333)
app.set('views', path.normalize(__dirname + '/public'))
app.set('view engine', 'ejs')
app.engine('html', require('ejs').renderFile)
app.use(express.static(path.join(__dirname, 'public')))
app.all('/*', function (req, res) {
res.render('index.html')
})
var server = http.createServer(app)
server.listen(app.get('port'), function() {
console.log("Express server listening on port " + app.get('port'))
console.log("Server is running on " + (process.env.NODE_ENV || "development") + " mode")
})