Application for authentication and authorization
OAuth server Subdomain name: auth.example.com
REST server Subdomain name: api.example.com
-
assets | Here are stored the files relevant to API operation
- docs | Documentation of every entity, router, imports, package or libraries that was created by us.
-
config | Configuration files
-
models | Data persistence layer (aka entities | databases documents )
-
routes | Business layer, Contains the logic, procedures and functions
//Note: server.js Web service entry point ( executable )
The names of the folders and files are going lowercase Variables: camelCase, varUser, CONSTANTAUTH Classes: Methods: Functions:
-
Every endpoint in lowercase and the noun in plural ( nouns )
-
prifix: /v0 (Last release version )
/v0/entity/nouns
Example:
- [GET] /v1/users/1
- [POST] /v1/users/1
- [PUT] /v1/users/1
- [DELETE] /v1/users/1
Methods | description |
---|---|
GET |
Get a resource |
POST |
Create a resource |
PUT |
Update a resource / Disable |
DELETE |
Delete a resource |
Methods | description |
---|---|
200 |
Success - OK |
201 |
Success - Created new resource |
204 |
Success - There is no content to answer |
400 |
Bad request - your request can not be assessed |
401 |
Unauthorized - user in this authenticated for this feature |
404 |
Not found - Resource doesn't exists |
422 |
unprocessable entity - validation errors |
429 |
Exceeded usage limits, try later |
500 |
Server error |
503 |
Service not available |