Skip to content

Commit

Permalink
๐Ÿ“ [#3] API Handler ์•„ํ‹ฐํด ๋ฐœํ–‰์ผ์ž ์˜คํƒˆ์ž๋ฅผ ์ˆ˜์ •ํ•œ๋‹ค
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoungqu23 committed Feb 19, 2024
1 parent 69d584a commit 7a1eddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contents/articles/nextjs-page-router-api-handler.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Nextjs API Handler
description: Nextjs์—์„œ withHandler๋ฅผ ํ™œ์šฉํ•ด API Routes์˜ ์ค‘๋ณต ์ฝ”๋“œ๋ฅผ ์ œ๊ฑฐํ•˜๊ธฐ
createdAt: 2023-06-26
createdAt: 2023-07-20
category: Next.js
tags:
- React
Expand Down Expand Up @@ -39,7 +39,7 @@ type WithHandler = (
) => (req: NextApiRequest, res: NextApiResponse) => Promise<void>;

// withHandler ๊ณ ์ฐจ ํ•จ์ˆ˜ ๊ตฌํ˜„
const withHandler: WithHandler = (handler) => async (req, res) => {
const withHandler: WithHandler = handler => async (req, res) => {
try {
// Request Handler ํ•จ์ˆ˜ ์‹คํ–‰ ์ด์ „์˜ ๋กœ์ง ์ถ”๊ฐ€
console.log('Preparing to handle request...');
Expand Down

0 comments on commit 7a1eddc

Please sign in to comment.