Преглед на файлове

Proxy requests to /api to backend server

sbkwgh преди 8 години
родител
ревизия
7c522c1fb3
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 6 1
      config/index.js

+ 6 - 1
config/index.js

@@ -21,7 +21,12 @@ module.exports = {
     port: 8080,
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: {},
+    proxyTable: {
+        '/api': {
+            target: 'http://localhost:3000',
+            changeOrigin: true
+        }
+    },
     // CSS Sourcemaps off by default because relative paths are "buggy"
     // with this option, according to the CSS-Loader README
     // (https://github.com/webpack/css-loader#sourcemaps)