-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
67 lines (57 loc) · 1.72 KB
/
server.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
var express = require('express');
var request = require('request');
var path = require('path');
var app = express();
app.use(express.static('public'));
var JIRA_URL = "https://jira.lan.courtanet.net";
app.get('/rest/api/2/search', function (req, res) {
request(JIRA_URL + req.url, function (error, response, body) {
if (!error && response.statusCode == 200) {
res.setHeader('Content-Type', 'application/json');
res.send(body);
}
})
});
app.all('*', function (req, res) {
//res.sendFile("./public/index.html");
res.sendFile(path.join(__dirname, './public', 'index.html'));
});
app.listen(8080);
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
new WebpackDevServer(webpack(config), {
contentBase: "./public",
hot: true,
historyApiFallback: true,
colors: true,
stats: 'normal',
proxy: {
"*": "http://localhost:8080"
},
publicPath: "http://0.0.0.0:8081",
host: "http://0.0.0.0"
}).listen(8081, 'localhost', function (err, result) {
if (err) {
return console.log(err);
}
console.log('Listening at http://localhost:8081/');
});
// we start a webpack-dev-server with our config
// var webpack = require('webpack');
// var WebpackDevServer = require('webpack-dev-server');
// var config = require('./webpack.config.js');
//
// new WebpackDevServer(webpack(config), {
// hot: true,
// historyApiFallback: true,
// proxy: {
// "*": "http://localhost:8080"
// }
// }).listen(8081, 'localhost', function (err, result) {
// if (err) {
// console.log(err);
// }
//
// console.log('Listening at localhost:8081');
// });