[now-go] Add support for root go.mod in api directory (#3793)

Some users wish to put all Go related code in the `/api` directory and the root is reserved for a frontend framework.

This PR adds support for `/api/go.mod` which will act the same as `/go.mod` by moving the file to the root.
This commit is contained in:
Steven
2020-02-14 12:32:20 -05:00
committed by GitHub
parent a9bf011f2c
commit 1a046744f2
7 changed files with 84 additions and 61 deletions

View File

@@ -53,6 +53,19 @@ async function testDeployment(
}
const nowJson = JSON.parse(bodies['now.json']);
if (process.env.NOW_BUILDER_DEBUG) {
if (!nowJson.build) {
nowJson.build = {};
}
if (!nowJson.build.env) {
nowJson.build.env = {};
}
nowJson.build.env = {
NOW_BUILDER_DEBUG: process.env.NOW_BUILDER_DEBUG,
};
}
for (const build of nowJson.builds) {
if (builderUrl) {
if (builderUrl === '@canary') {