Browse Source
use netlify functions (#3961)
* use netlify functions
* fix: change url
pull/3978/head
陈帅
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
lambda/mock/matchMock.js
-
netlify.toml
|
|
|
@ -14,7 +14,7 @@ function parseKey(key) { |
|
|
|
method = spliced[0].toLowerCase(); |
|
|
|
path = spliced[1]; // eslint-disable-line
|
|
|
|
} |
|
|
|
const routerBasePath = process.env.NODE_ENV === 'dev' ? `${path}` : `/.netlify/functions${path}`; |
|
|
|
const routerBasePath = `${path}`; |
|
|
|
return { |
|
|
|
method, |
|
|
|
path: routerBasePath, |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
|
|
|
[[redirects]] |
|
|
|
from = "/api/*" |
|
|
|
to = "https://us-central1-antd-pro.cloudfunctions.net/api/api/:splat" |
|
|
|
to = "/.netlify/functions/api/:splat" |
|
|
|
status = 200 |
|
|
|
force = true |
|
|
|
[redirects.headers] |
|
|
|
|