Course lesson

Migrate Add Customer Api Route By Creating POST Method in Customer Route Handler

Migrating a POST route to the app router will look very familiar to the GET route that we already migrated.

Duration
4 min
Access
Free
Transcript
Needs source

Migrating a POST route to the app router will look very familiar to the GET route that we already migrated.

Here we will covert our responses to return NextResponse json. All of the logic that was previously inside the API route is left the same.