Next.js Discord

Discord Forum

Anyone have any good open source examples of a REST API using route handlers?

Answered
dperolio posted this in #help-forum
Open in Discord
Looking for some "real world" examples of well-written REST API using route handlers. I'm interested in seeing what other people do for response and error handling.

10 Replies

@ᴉuɐpɹɐɐ just to be clear, you're making a public API right?
Right. My API currently works, but I'd like to clean it up, and gain some real-world inspiration for permission checking, data validation, and error handling.
Answer
Eh, thanks for trying, but I don't find any of those particularly inspiring or useful. They're also API routes, not route handlers, but that's not a big deal.
As far as I know, not much. Syntax. Route handlers are the "API routes" for app dir.
Right, that's why I said it's not a big deal. I'm more interested in the concepts.
perhaps you might be just over-polishing your codes a little bit
Yes, it's a hobby of mine.