-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: app server pings with updated manifest
- Loading branch information
Showing
4 changed files
with
21 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ServerBuild } from "@remix-run/server-runtime"; | ||
|
||
export let ping = (build: ServerBuild) => { | ||
let httpPort = Number(process.env.REMIX_DEV_HTTP_PORT); | ||
if (!httpPort) throw Error("REMIX_DEV_HTTP_PORT not set"); | ||
if (isNaN(httpPort)) | ||
throw Error(`REMIX_DEV_HTTP_PORT must be a number. Got: ${httpPort}`); | ||
|
||
fetch(`http://localhost:${httpPort}/ping`, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ buildHash: build.assets.version }), | ||
}); | ||
}; |
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