Skip to content

Migrate to Route Handlers from API Routes #83

@aryanprince

Description

@aryanprince

Summary

Basically switching from pages/api to app/api. They do the same thing, but the new app directory is much better (see below why).

Why

  • There's lotta new features
  • Better web standards being maintained in the new app router (app router now uses more standard APIs instead of using proprietary APIs in prev pages router)
  • Easy to set up different REST API endpoints just by using functions with verbs as names. Need a GET endpoint? Create a GET() function. Need a POST/PUT/DELETE endpoint? Create a function with that name, that's it.

Basically the app router is the future of Next.js and it would be awesome if we could migrate.

Shouldn't be that complex of a migration, compared to the nightmare of switching the 'frontend' code to app router, remember that big PR (#36) I made few weeks ago? 😂

Links to Docs

Our existing API Routes: Pages Router - API Routes

New API Route Handlers: App Router - Route Handlers

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions