-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
33 lines (27 loc) · 836 Bytes
/
server.js
File metadata and controls
33 lines (27 loc) · 836 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
32
33
'use strict';
var WebpackDevServer = require("webpack-dev-server");
var webpack = require("webpack");
var config = require('./webpack.config');
var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
publicPath: config.output.publicPath,
contentBase: './public/',
hot: true,
quiet: false,
noInfo: false,
proxy: {
"/api/*": "http://localhost:8081"
},
stats: { colors: true }
});
server.listen(8080, "localhost", function() {
console.info("==> 🌎 WebpackDevServer listening on port %s. Open up http://localhost:%s/ in your browser.", 8080, 8080);
});
var express = require('express');
var app = express();
app.get('/api/test', function (req, res) {
res.send('Hello World!');
});
app.listen(8081, function () {
console.log('==> 🌎 Backend app listening on port 8081!');
});