79566294

Date: 2025-04-10 09:50:54
Score: 1
Natty:
Report link

They're pretty much handled the same under the hood by Nitro. The main differences are mostly about semantics and organization. If you put files in server/api, it's just a clear way to tell other devs (and yourself) that these endpoints are meant for API stuff, like handling JSON or similar responses. Plus, you might get some automatic goodies like JSON body parsing. But if you drop your endpoint in server/routes, it's just as flexible but doesn't come with those extra conventions, it's more generic. So, it's less about how the request is processed and more about keeping your project organized.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Salt