-
Notifications
You must be signed in to change notification settings - Fork 71
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
1ce3325
commit ff79e33
Showing
6 changed files
with
50 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SOURCEBOT_VERSION } from "@/lib/environment"; | ||
import { GetVersionResponse } from "@/lib/types"; | ||
|
||
// Note: In Next.JS 14, GET methods with no params are cached by default at build time. | ||
// This creates issues since environment variables (like SOURCEBOT_VERSION) are | ||
// not available until runtime. To work around this, we fore the route to be | ||
// dynamic and evaluate on each request. | ||
// @see: https://nextjs.org/docs/14/app/building-your-application/routing/route-handlers#caching | ||
export const dynamic = "force-dynamic"; | ||
|
||
export const GET = async () => { | ||
return Response.json({ | ||
version: SOURCEBOT_VERSION, | ||
} satisfies GetVersionResponse); | ||
} |
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
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