Skip to content

Commit

Permalink
Merge pull request #126 from helium/mbthiery/catch-all
Browse files Browse the repository at this point in the history
Catch-all for all supported HTTP methods
  • Loading branch information
mbthiery authored Feb 14, 2024
2 parents 0f29c9c + f528915 commit e7f78f3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/app/[...rest]/page.tsx

This file was deleted.

24 changes: 24 additions & 0 deletions src/app/[...rest]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { redirect } from "next/navigation"
import { NextResponse } from "next/server"

export async function GET() {
return redirect("/")
}
export async function POST() {
return new NextResponse(null, { status: 404 })
}
export async function PUT() {
return new NextResponse(null, { status: 404 })
}
export async function PATCH() {
return new NextResponse(null, { status: 404 })
}
export async function DELETE() {
return new NextResponse(null, { status: 404 })
}
export async function HEAD() {
return new NextResponse(null, { status: 404 })
}
export async function OPTIONS() {
return new NextResponse(null, { status: 404 })
}

0 comments on commit e7f78f3

Please sign in to comment.