apeman-api-recover
Recover API for apeman
Installation
$ npm install apeman-api-recover --save
Usage
Define a module in Apemanfile and run the server.
/** Example of Apemanfile.js */ 'use strict' const co = let NODE_ENV = processenvlet User UserSign UserRecover = moduleexports = $cwd: __dirname $pkg: /* ... */ $proto: /* ... */ $api: // Define APIs 'module01': User UserSign UserRecover logging: NODE_ENV === 'development'
Then, call the module from client script
#!/usr/bin/env node /** * Example client */'use strict' const co = const apemanApiClient =
Methods
The following methods are provided by the API
.ping(pong)
Test the reachability of the api.
Param | Type | Description |
---|---|---|
pong | string |
Pong message to return |
.issue(email)
Issue recover token to email
Param | Type | Description |
---|---|---|
string |
.check(token)
Confirm email
Param | Type | Description |
---|---|---|
token | string |
Recover token |
.update(token, newPassword)
Update password
Param | Type | Description |
---|---|---|
token | string |
Recover token |
newPassword | string |
New password |
.one(id)
Get an recover
Param | Type | Description |
---|---|---|
id | string |
.last(email)
Get last recover for current user
Param | Type | Description |
---|---|---|
string |
License
This software is released under the MIT License.