Answer the question
In order to leave comments, you need to log in
How to link node-server & webpack-dev-server?
Hello! Help with configs (node-express-server.js + webpack-dev-server.config)
to get rid of cors-problem on localhost. I am doing a bunch of node-server + webpack-dev-server through a proxy. I have difficulties with node-server and paths, this is my first time doing it.
my webpack:
var path = require('path')
module.exports = {
devtool: 'source-map',
entry: [
'./src/indexCurrent.js'
],
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/static/'
},
devServer: {
proxy: [{
path: '/api/',
target: 'http://localhost:3001'
}],
historyApiFallback: true
},
//далее лодеры включены
Answer the question
In order to leave comments, you need to log in
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors());
// ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question