Api route handler
Answered
wWHYSOSERIOUSs posted this in #help-forum
im using a GET, POST, PATCH... pattern while defining my api routes in the route.ts but in docs im seeing handler function , can someone explain me if im using the outdated or the docs in seeing is outdated ?
Answered by joulev
GET/POST/PATCH are for the app router
handler() and res.json() are for the pages router
handler() and res.json() are for the pages router
4 Replies
@wWHYSOSERIOUSs im using a GET, POST, PATCH... pattern while defining my api routes in the route.ts but in docs im seeing handler function , can someone explain me if im using the outdated or the docs in seeing is outdated ?
GET/POST/PATCH are for the app router
handler() and res.json() are for the pages router
handler() and res.json() are for the pages router
Answer
can you please give me docs for app and pagerouter , i cant find i guess
ty sooo much bro u saved my life ;-;