Skip to content

Commit

Permalink
solang build server
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Aug 16, 2024
1 parent 935ff8d commit 4db610a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
BUILD_SERVER_BASE_URL=https://playground-next.test.aelf.dev
BUILD_SERVER_BASE_URL=https://playground.test.aelf.dev
SOLANG_BUILD_SERVER_BASE_URL=https://playground-next.test.aelf.dev
GA_TAG=
GITHUB_API_KEY=
6 changes: 2 additions & 4 deletions app/api/build/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileContent } from "@/data/db";
import { getBuildServerBaseUrl } from "@/lib/env";
import { getBuildServerBaseUrl, getSolangBuildServerBaseUrl } from "@/lib/env";
import { fileContentToZip } from "@/lib/file-content-to-zip";
import { type NextRequest } from "next/server";
import { v4 as uuidv4 } from "uuid";
Expand Down Expand Up @@ -52,12 +52,10 @@ export async function POST(request: NextRequest) {
};

const response = await fetch(
`${getBuildServerBaseUrl()}/api/solang/build`,
`${getSolangBuildServerBaseUrl()}/api/solang/build`,
requestInit
);

console.log(response);

if (!response.ok) {
const { message } = await response.json();
return Response.json({ error: message }, { status: response.status });
Expand Down
4 changes: 4 additions & 0 deletions lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export function getBuildServerBaseUrl() {
return getEnv("BUILD_SERVER_BASE_URL");
}

export function getSolangBuildServerBaseUrl() {
return getEnv("SOLANG_BUILD_SERVER_BASE_URL");
}

export function getGoogleAnalyticsTag() {
return getEnv("GA_TAG");
}
Expand Down

0 comments on commit 4db610a

Please sign in to comment.