2 Commity ad1273a57f ... c1a1a4233b

Autor SHA1 Wiadomość Data
  mickey135 c1a1a4233b Merge branch 'dev' of http://www.lj2.top:3000/precaution/precaution-frontend into dev 2 miesięcy temu
  mickey135 2f64b75248 feat:配置本地环境 2 miesięcy temu
2 zmienionych plików z 11 dodań i 1 usunięć
  1. 1 1
      package.json
  2. 10 0
      proxy.dev.conf.json

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "0.0.0",
   "scripts": {
     "ng": "ng",
-    "start": "ng serve --port 4201",
+    "start": "ng serve --open --port 4201 --proxy-config=proxy.dev.conf.json",
     "start:prod": "ng serve --open --port 4201 --proxy-config=proxy.prod.conf.json",
     "start:stage": "ng serve --open --port 4201 --proxy-config=proxy.stage.conf.json",
     "format": "prettier --write \"src/**/*.(ts|html|less)\"",

+ 10 - 0
proxy.dev.conf.json

@@ -0,0 +1,10 @@
+{
+  "/api": {
+    "target": "http://127.0.0.1:3002",
+    "secure": false,
+    "changeOrigin": true,
+    "pathRewrite": {
+      "^/api": ""
+    }
+  }
+}