Matteo Scandolo | cf06077 | 2016-05-13 15:54:44 -0700 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | var http = require('http'); |
| 4 | // var httpProxy = require('http-proxy'); |
| 5 | var connect = require('connect'); |
| 6 | var serveStatic = require('serve-static'); |
| 7 | var path = require('path'); |
| 8 | |
| 9 | var conf = { |
| 10 | paths: { |
| 11 | root: '../../../../../' |
| 12 | }, |
| 13 | port: '8182' |
| 14 | } |
| 15 | |
| 16 | var httpProxyInit = function (baseDir) { |
| 17 | |
| 18 | var app = connect(); |
| 19 | |
| 20 | app.use(serveStatic(path.join(__dirname, baseDir))); |
| 21 | |
| 22 | var server = http.createServer(app); |
| 23 | |
| 24 | server.listen(conf.port, function(){ |
| 25 | console.log('Dev server is up and listening on http://localhost:', conf.port); |
| 26 | }); |
| 27 | }; |
| 28 | |
| 29 | httpProxyInit(conf.paths.root); |