After installing node.js and mySql server, the back end can be setup by
git clone https://github.com/fa93hws/tipping.git cd tipping npm install
To start the server, simply type the following and go http://localhost:3000 to have a check.
npm start
and type the following to terminate
npm stop
- Refactoring to OOP
- Log-in Modulue
- User login/sign system
- Update user profile
- Reset Password
- Single game play prototype
It is used to post sign-up info to the server to regisiter an account.
input | description |
---|---|
username | username |
email address | |
password | a sha256 string |
status | description |
---|---|
200 | success |
400 | Failed |
It is used to post login info to the server to get the uid. Input can be user or email and return with json-web-token if correct.
input | description |
---|---|
username or email | string |
password | a sha256 string |
status | description |
---|---|
200 | success |
401 | Failed |
It will return the detail of the user profile.
- input: json web token
- outpu: personal detail (see ERR diagram in sql for detail)
input | description |
---|---|
sex | F,M or DK |
imageurl | portrait |
birthday | yyyy-mm-dd |
location | any text |
phone | any-text |
display name | any-text |
output | description |
---|---|
200 | success |
400 | failed |
Send the email address in token and the sever will send the email to the target email account. Even if the email address doesn't exists in the database, the message will imply success any way.
input | description |
---|---|
sign-up email address |
output | description |
---|---|
200 | success |
When receiving the email, user can reset the password based on the link provided. Link and request will be invalid after the token is expired (15 minutes after apply)
output | description |
---|---|
200 | success |
400 | failed |