Anyone have any good open source examples of a REST API using route handlers?
Answered
dperolio posted this in #help-forum
dperolioOP
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
@dperolio 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.
just to be clear, you're making a public API right?
@ᴉuɐpɹɐɐ just to be clear, you're making a public API right?
dperolioOP
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
dperolioOP
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.
@dperolio 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.
whats the difference between api routes and route handlers
dperolioOP
As far as I know, not much. Syntax. Route handlers are the "API routes" for app dir.
@dperolio As far as I know, not much. Syntax. Route handlers are the "API routes" for app dir.
yeah but you can just convert those to App dir
dperolioOP
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
dperolioOP
Yes, it's a hobby of mine.