-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from axiomhq/handle-next-not-found-and-redire…
…ct-errors fix: handle NEXT_NOT_FOUND & NEXT_REDIRECT errors
- Loading branch information
Showing
12 changed files
with
1,557 additions
and
1,296 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,9 @@ | ||
import { AxiomRequest, withAxiom } from 'next-axiom'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
export const runtime = 'nodejs'; | ||
|
||
// test handling NEXT_NOT_FOUND error | ||
export const GET = withAxiom(async (req: AxiomRequest) => { | ||
return notFound() | ||
}); |
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,9 @@ | ||
import { AxiomRequest, withAxiom } from 'next-axiom'; | ||
import { permanentRedirect } from 'next/navigation'; | ||
|
||
export const runtime = 'nodejs'; | ||
|
||
// test handling NEXT_REDIRECT error with status code 308 | ||
export const GET = withAxiom(async (req: AxiomRequest) => { | ||
return permanentRedirect('/') | ||
}); |
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,10 @@ | ||
import { AxiomRequest, withAxiom } from 'next-axiom'; | ||
import { redirect } from 'next/navigation'; | ||
|
||
export const runtime = 'nodejs'; | ||
|
||
|
||
// test handling NEXT_REDIRECT error | ||
export const GET = withAxiom(async (req: AxiomRequest) => { | ||
return redirect('/') | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.