Frest is the frame of the restful api server created with pallets/flask.
Basic restful api server including login, sign up, sign out, modify account, writing, and etc..
Just modify app/config
and python app.py runserver
use it.
API
GET /api/v@/
Return environment, versionsPOST /api/v@/auth
LoginPOST /api/v@/logout
Sign outGET /api/v@/users
Get users with token and params: page(Default: 0), limit(Default: 10)POST /api/v@/users
Sign UpGET /api/v@/users/<prefix(me or user_id)>
Return user informationPUT /api/v@/users/<prefix(me or user_id)>
Modify user informationDELETE /api/v@/users/<prefix(me or user_id)>
Delete userGET /api/v@/token?type=extension&token=<token>
Token expire time extensionGET /api/v@/users/<prefix(me or user_id)>/login_histories
Return Login histories with token and params: page(Default: 0), limit(Default: 10)
FUNCTION
- Auto route loading
app/routes
- Decorating return values
app/modules/frest/api
- You can expire token with function
app/models/user_token_model
token_expire_all, token_expire_with_token
How to generate apidoc
//install
npm install apidoc -g
//run
apidoc -i ./ -o ./app/static/doc
//in directory ./app/static/doc, apidoc will be generated
- User role development
Copyright (c) 2017 Hawl Kim
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.