![](http://i.imgur.com/0W8wQDR.png)
Sailor Module User
Module User for Sailor
Install
Install as dependency in your sailor base application:
sailor install sailor-module-user [--save or --save-dev]
API
Basic CRUD
Register new user
POST /user
The minimum information to create a new user is:
Check the User Model for know the required, optional and the restriction of each field.
Find all Users
GET /user
Find One User
GET /user/:id
You can specified the user that you want to recover in the url by id:
GET /user/1
or create a more specified query using url params:
GET /user/?username=user2&email=user2@sailor.com
Destroy an User
DELETE /user/:id
Authentication
Login
POST /user/login
You can login a user with his username:
or with the email:
Logout
GET /user/logout
Relationship
get following or followers users
GET /user/:id/following
or
GET /user/:id/follower
starts follow other User
POST /user/:id/following
with:
status relationship
GET /user/:id/following/status
with:
unfollow
DELETE /user/:id/following
with: