-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathserver.js
More file actions
31 lines (26 loc) · 764 Bytes
/
server.js
File metadata and controls
31 lines (26 loc) · 764 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
31
/**
* Created by vseereer on 11/19/15.
*/
var proxy = require('express-http-proxy');
var url = require('url');
var path = require('path');
var express = require('express');
var app = express();
app.use('/api', proxy('http://localhost', {
port: 8181,
forwardPath: function(req, res) {
return url.parse(req.url).path;
}
}));
app.use('/api2', proxy('http://localhost', {
port: 8282,
forwardPath: function(req, res) {
return url.parse(req.url).path;
}
}));
app.use(
"/", //the URL throught which you want to access to you static content
express.static(__dirname) //where your static content is located in your filesystem
);
app.listen(8000); //the port you want to use
console.log('Serving IoT VizConf @ 8000');