Skip to content

Commit c02a417

Browse files
committed
load .env and .env.local equally
1 parent c01898a commit c02a417

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mocks/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import "dotenv/config";
21
import type { IncomingMessage, ServerResponse } from "node:http";
32
import { createServer } from "@mswjs/http-middleware";
3+
import { config } from "dotenv";
44
import { handlers } from "./handlers";
55

6+
// Load .env first, then .env.local (which overrides .env)
7+
config();
8+
config({ path: ".env.local" });
9+
610
// Mock server runs on the port configured in API_BASE_URL
711
// This ensures the app can reach the mock server at the expected URL
812
const apiBaseUrl = process.env.API_BASE_URL;

0 commit comments

Comments
 (0)