Skip to content

Commit 25bb097

Browse files
committed
🔧 make leetcode API endpoint environment variable
1 parent d12dec4 commit 25bb097

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM node:20-alpine
22

3+
ARG LEETCODE_API_ENDPOINT
4+
35
COPY ./packages/server/dist .
46
COPY ./packages/server/package.json .
57
COPY ./packages/asset/dist asset

‎packages/server/src/routers/leetcode/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Router } from "express";
22

3-
const ENDPOINT = "https://alfa-leetcode-api.onrender.com";
3+
const { LEETCODE_API_ENDPOINT = "http://localhost:3000" } = process.env;
44

55
const router = Router();
66

77
router.get("*", async (request, response) => {
88
try {
9-
const url = new URL(ENDPOINT);
9+
const url = new URL(LEETCODE_API_ENDPOINT);
1010
url.pathname = request.path;
1111
for (const key in request.query) {
1212
url.searchParams.append(key, request.query[key] as string);

0 commit comments

Comments
 (0)