We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c01898a commit c02a417Copy full SHA for c02a417
src/mocks/server.ts
@@ -1,8 +1,12 @@
1
-import "dotenv/config";
2
import type { IncomingMessage, ServerResponse } from "node:http";
3
import { createServer } from "@mswjs/http-middleware";
+import { config } from "dotenv";
4
import { handlers } from "./handlers";
5
6
+// Load .env first, then .env.local (which overrides .env)
7
+config();
8
+config({ path: ".env.local" });
9
+
10
// Mock server runs on the port configured in API_BASE_URL
11
// This ensures the app can reach the mock server at the expected URL
12
const apiBaseUrl = process.env.API_BASE_URL;
0 commit comments