Unverified Commit 4d639359 authored by 陈帅's avatar 陈帅 Committed by GitHub

use netlify functions (#3961)

* use netlify functions

* fix: change url
parent 7e2500c7
...@@ -14,7 +14,7 @@ function parseKey(key) { ...@@ -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,
......
...@@ -3,7 +3,7 @@ ...@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment