forked from QuinntyneBrown/ng2Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
24 lines (20 loc) · 628 Bytes
/
server.js
File metadata and controls
24 lines (20 loc) · 628 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
'use strict'
const httpServer = require('http-server')
console.log('Hot-reload via jspm')
var cache = 3600
if (process.env.NODE_ENV === 'production') {
console.log('running in production mode(with caching)-make sure you have "Disable cache (while DevTools is open)" checked in the browser to see the changes while developing')
} else {
cache = -1
}
const server = httpServer.createServer({
root: './',
cache: cache,
robots: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'true'
}
})
require('chokidar-socket-emitter')({app: server.server})
server.listen(9089)