From 4d639359b4b25fc8735fc22e22bff616c1d00747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Wed, 10 Apr 2019 20:13:01 +0800 Subject: [PATCH] use netlify functions (#3961) * use netlify functions * fix: change url --- lambda/mock/matchMock.js | 2 +- netlify.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda/mock/matchMock.js b/lambda/mock/matchMock.js index 94027802..d7423612 100644 --- a/lambda/mock/matchMock.js +++ b/lambda/mock/matchMock.js @@ -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, diff --git a/netlify.toml b/netlify.toml index 5ecaa964..9d3438c4 100644 --- a/netlify.toml +++ b/netlify.toml @@ -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] -- GitLab