-
Notifications
You must be signed in to change notification settings - Fork 1
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
361cd7a
commit 0a5b961
Showing
4 changed files
with
16 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
/* Core */ | ||
import { NextResponse } from 'next/server' | ||
import { NextResponse } from "next/server"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export async function POST(req: Request, res: Response) { | ||
const body = await req.json() | ||
const { amount = 1 } = body | ||
const body = await req.json(); | ||
const { amount = 1 } = body; | ||
|
||
// simulate IO latency | ||
await new Promise((r) => setTimeout(r, 500)) | ||
await new Promise((r) => setTimeout(r, 500)); | ||
|
||
return NextResponse.json({ data: amount }) | ||
return NextResponse.json({ data: amount }); | ||
} |
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