Explorar o código

use netlify functions (#3961)

* use netlify functions

* fix: change url
陈帅 %!s(int64=6) %!d(string=hai) anos
pai
achega
4d639359b4
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      lambda/mock/matchMock.js
  2. 1 1
      netlify.toml

+ 1 - 1
lambda/mock/matchMock.js

@@ -14,7 +14,7 @@ function parseKey(key) {
     method = spliced[0].toLowerCase();
     method = spliced[0].toLowerCase();
     path = spliced[1]; // eslint-disable-line
     path = spliced[1]; // eslint-disable-line
   }
   }
-  const routerBasePath = process.env.NODE_ENV === 'dev' ? `${path}` : `/.netlify/functions${path}`;
+  const routerBasePath = `${path}`;
   return {
   return {
     method,
     method,
     path: routerBasePath,
     path: routerBasePath,

+ 1 - 1
netlify.toml

@@ -3,7 +3,7 @@
 
 
 [[redirects]]
 [[redirects]]
   from = "/api/*"
   from = "/api/*"
-  to = "https://us-central1-antd-pro.cloudfunctions.net/api/api/:splat"
+  to = "/.netlify/functions/api/:splat"
   status = 200
   status = 200
   force = true
   force = true
   [redirects.headers]
   [redirects.headers]