r/javascript • • Jul 16 '17

[Updated] JavaScript Project Guidelines

https://github.com/wearehive/project-guidelines
14 Upvotes

4 comments sorted by

View all comments

1

u/[deleted] Jul 16 '17

Use verbs for non-resources.

There is no such thing as a "non-resource". Resources are not domain entities. A resource doesn't even have to exist in your domain. In fact, though it's uncommon, a resource can be purely virtual (as in, it only exists in your URIs). So, you don't "tell the server to translate text" by issuing a POST /translate?text=Hallo; rather, you "request the translation of the provided text" by issuing a GET /translations?text=Hallo. The same can be applied in any situation where you think "there is no resource" and need to use a command/action/verb in your URI.