forked from vijay00m/UI5SplitApp-Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_server.js
More file actions
30 lines (23 loc) · 708 Bytes
/
dev_server.js
File metadata and controls
30 lines (23 loc) · 708 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
// API doc of expressjs app.use(): http://expressjs.com/api.html#app.use
// write express args into an url config object
var urlConfig = {
protocol : process.argv[2],
host : process.argv[3],
port : process.argv[4],
urlPath : process.argv[5]
}
// setup express
var express = require('express'),
app = express(),
urlPath = urlConfig.urlPath,
port = urlConfig.port;
// set default mime type
express.static.mime.default_type = "text/xml";
// enable compression
app.use(express.compress());
// serve static content
app.use(urlPath, express.static(__dirname));
// enable directory listening
app.use(urlPath, express.directory(__dirname));
// set port to listen
app.listen(port);