Altschool Second Semester Exam Project
- User should be able to register
- User should be able to login with Passport using JWT
- Implement basic auth
- User should be able to get orders
- Users should be able to create orders
- Users should be able to update and delete orders
- Test application
- Install NodeJS, mongodb
- pull this repo
- update env with example.env
- run
npm run start:dev
- somehostsite.com
| field | data_type | constraints |
|---|---|---|
| id | string | required |
| username | string | required |
| firstname | string | optional |
| lastname | string | optional |
| string | optional | |
| password | string | required |
| field | data_type | constraints |
|---|---|---|
| id | string | required |
| timestamp | date | required |
| state | String | required,default:draft |
| description | String | required |
| author | String | required |
| content | string | required |
| readCount | number | required |
| readingTime | string | required |
- Route: /signup
- Method: POST
- Body:
{
"email": "doe@example.com",
"password": "Password1",
"firstname": "jon",
"lastname": "doe",
"username": 'jon_doe",
}
- Responses
Success
{
message: 'Signup successful',
user: {
"email": "doe@example.com",
"password": "Password1",
"firstname": "jon",
"lastname": "doe",
"username": 'jon_doe",
}
}
- Route: /login
- Method: POST
- Body:
{
"password": "Password1",
"username": 'jon_doe",
}
- Responses
Success
{
message: 'Login successful',
token: 'sjlkafjkldsfjsd'
}
...
- Chidozie Inya