@@ -217,7 +217,10 @@ The following example sends a JSON response with the status code `200` (`OK`) an
217
217
``` ts filename="pages/api/hello.ts" switcher
218
218
import type { NextApiRequest , NextApiResponse } from ' next'
219
219
220
- export default async function handler(req : NextApiRequest , res : NextApiResponse ) {
220
+ export default async function handler(
221
+ req : NextApiRequest ,
222
+ res : NextApiResponse
223
+ ) {
221
224
try {
222
225
const result = await someAsyncOperation ()
223
226
res .status (200 ).json ({ result })
@@ -247,7 +250,10 @@ The following example sends a HTTP response with the status code `200` (`OK`) an
247
250
``` ts filename="pages/api/hello.ts" switcher
248
251
import type { NextApiRequest , NextApiResponse } from ' next'
249
252
250
- export default async function handler(req : NextApiRequest , res : NextApiResponse ) {
253
+ export default async function handler(
254
+ req : NextApiRequest ,
255
+ res : NextApiResponse
256
+ ) {
251
257
try {
252
258
const result = await someAsyncOperation ()
253
259
res .status (200 ).send ({ result })
@@ -277,7 +283,10 @@ The following example redirects the client to the `/` path if the form is succes
277
283
``` ts filename="pages/api/hello.ts" switcher
278
284
import type { NextApiRequest , NextApiResponse } from ' next'
279
285
280
- export default async function handler(req : NextApiRequest , res : NextApiResponse ) {
286
+ export default async function handler(
287
+ req : NextApiRequest ,
288
+ res : NextApiResponse
289
+ ) {
281
290
const { name, message } = req .body
282
291
283
292
try {
0 commit comments