Skip to content

a deadly simple user system run by nodejs, expressjs, mongodb, mongoose and passportjs

Notifications You must be signed in to change notification settings

yi/cmbase-user-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

最基本的用户系统

============

API

用户登录

path: /api/login

method: POST

request 参数:

  • username
  • password

response 结果

  • 登录成功的话: 返回http状态200, body是json数据格式:{ "id": "5305a56964626a8b061de161", "success": true }
  • 登录失败的话: 返回http状态401

示例:

 curl -X POST -d "username=test1&password=112233" http://localhost:3000/api/login -v

用户注册

path: /api/signup

method: POST

request 参数:

  • username
  • password

response 结果

  • 注册成功的话: 返回http状态200, body是json数据格式:{ "id": "5305a56964626a8b061de161", "success": true }
  • 注册失败的话: 返回http状态200, body是json数据格式:{ "error": "注册失败的原因", "success": false }

示例:

 curl -X POST -d "username=test1&password=112233" http://localhost:3000/api/signup -v

用户修改密码

path: /api/change_password

method: POST

request 参数:

  • username
  • password
  • new_password

response 结果

  • 修改密码成功的话: 返回http状态200, body是json数据格式:{ "id": "5305a56964626a8b061de161", "success": true }
  • 修改密码失败的话: 返回http状态200, body是json数据格式:{ "error": "注册失败的原因", "success": false }

示例:

 curl -X POST -d "username=test1&password=112233&new_password=556677" http://localhost:3000/api/change_password -v

============

##Demo

User system is writen CoffeeScript, run on nodejs illustrating the use of passport in express, jade and mongoose environment together with front pages for login, signup and profile mock built with Twitter Bootstrap

Includes login with Facebook, Twitter, Github and Google together with Passport LocalStrategy

Technology

On The Server On The Client
Express Bootstrap 3
Jade Backbone.js
Passport jQuery
Mongoose Underscore.js

操作命令

启动 coffee watch 进行编译


npm run-script watch

启动开发服务器


npm run-script start

License

MIT

About

a deadly simple user system run by nodejs, expressjs, mongodb, mongoose and passportjs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published