Socket
Book a DemoInstallSign in
Socket

ark-user

Package Overview
Dependencies
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ark-user

Plugin for handling all routes, which relate to a user.

latest
Source
npmnpm
Version
4.7.1
Version published
Maintainers
4
Created
Source

User

Routes

####GET

RessourceDescriptionon Successon Failure
/usersreturns all usersjson objectstatusCode: 404
/users/:userIDreturns profile information for requested user IDjson objectstatusCode: 404
/users/mereturns profile of current userjson objectstatusCode: 404
/users/:userID/:file.:extreturns the profile picture of the user with the requested IDimage streamstatusCode: 404

####POST

RessourceDescriptionon Successon Failure
/userscreate new userstatusCode: 200statusCode: 404
/users/my/picturecreate a new profile picturejson object with the destination of the picturestatusCode: 404

####PUT

RessourceDescriptionon Successon Failure
/users/meupdate user informationstatusCode: 200statusCode: 404
/users/my/passwordupdate user passwordstatusCode: 200statusCode: 404
/users/:userID/passwordupdate password of user by idstatusCode: 200statusCode: 404
/users/:userIDupdate particular userstatusCode: 200statusCode: 404
/users/my/pictureupdate the profile picturejson object with the destination of the picturestatusCode: 404

####DELETE

RessourceDescriptionon Successon Failure
/users/:userIDdelete user by useridstatusCode: 200statusCode: 404

Dummy Json Results

  • Getting a user
{
   _id: '4234324342',
   _rev: '1-dbe58c4eb46dc66b3b62ed4dfab2f3fe',
   name: 'Doe',
   surname: 'John',
   description: 'Ich bin Steffen Ich bin Steffen, Steffen wollt ich schon immer sein',
   age: 27,
   residence: 'Konstanz',
   "imageLocation": {
     "picture": "/i/users/368f5b48e4f45213ed912dd1e30377df/profile.png",
     "thumbnail": "/i/users/368f5b48e4f45213ed912dd1e30377df/profile-thumb.png"
   },
   mail: 'john.doe@info.de',
   password: 'secret',
   type: 'user'
}
  • Creating/Updating a profile picture
 {
   "message": "ok",
   "imageLocation": {
     "picture": "/i/users/368f5b48e4f45213ed912dd1e30377df/profile.png",
     "thumbnail": "/i/users/368f5b48e4f45213ed912dd1e30377df/profile-thumb.png"
   }
 }

"/i" in the url will be transformed to /api/vX/ from nginx on the server side

FAQs

Package last updated on 15 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts