-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f781058
commit 230f993
Showing
5 changed files
with
44 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { rest } from "msw"; | ||
import { http, passthrough } from "msw"; | ||
import { setupServer } from "msw/node"; | ||
|
||
// put one-off handlers that don't really need an entire file to themselves here | ||
const miscHandlers = [ | ||
rest.post(`${process.env.REMIX_DEV_HTTP_ORIGIN}/ping`, (req) => | ||
req.passthrough(), | ||
), | ||
http.post(`${process.env.REMIX_DEV_HTTP_ORIGIN}/ping`, () => passthrough()), | ||
]; | ||
|
||
const server = setupServer(...miscHandlers); | ||
|
||
server.listen({ onUnhandledRequest: "bypass" }); | ||
console.info("🔶 Mock server running"); | ||
|
||
process.once("SIGINT", () => server.close()); | ||
process.once("SIGTERM", () => server.close()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters