DEV Community

Buddhi Vikasitha
Buddhi Vikasitha

Posted on

Best content to include in a default route?

I feel like this is a good point for a discussion and not a question. I have the set of URLs as follows.

https://domain/api/users
https://domain/api/users/:userId
https://domain/api/posts
https://domain/api/posts/:postId

As usual I return json content when the above APIs are called.

What should be returned if the following APIs are called?

https://domain/api/
https://domain/

Is it just 404-Not Found?
What is more suitable?

Top comments (0)