Todo Application Backend APIs
-
URL
/api/v1/auth/sign-up
-
Method:
POST
-
URL Params
None
-
Data Params
Required:
username=[String]
password=[String]
-
Success Response:
- Code: 200
Content:{ id : 6074fb9d7e8466001570e7db, username: "samir784", createdAt: "2021-03-19T19:29:33.231Z", updatedAt: "2021-03-19T19:29:33.231Z" }
- Code: 200
-
Error Response:
- Code: 409 Resource Already Exists
Content:{ error : "Username already exist" }
OR
- Code: 401 Missing Credentials
Content:{ error : "Username or Password is Missing" }
- Code: 409 Resource Already Exists
-
Sample Call:
axios.post(
"https://todo-samir.herokuapp.com/api/v1/auth/sign-up",
{
"username": "samir784",
"password": "748547854"
});
-
URL
/api/v1/auth/sign-in
-
Method:
POST
-
URL Params
None
-
Data Params
Required:
username=[String]
password=[String]
-
Success Response:
- Code: 200
Content:{ id : 6074fb9d7e8466001570e7db, username: "samir784", createdAt: "2021-03-19T19:29:33.231Z", updatedAt: "2021-03-19T19:29:33.231Z" }
- Code: 200
-
Error Response:
- Code: 401 Unauthorized
Content:{ error : "Invalid Username or Password!" }
OR
- Code: 401 Missing Credentials
Content:{ error : "Username or Password is Missing" }
- Code: 401 Unauthorized
-
Sample Call:
axios.post(
"https://todo-samir.herokuapp.com/api/v1/auth/sign-in
{
"username": "samir784",
"password": "748547854"
});
|
|- public # Any files within this directory will not be processed by Webpack but copied directly to the build folder.
|- src: # Contains all source code for the React application.
|
|- components # Contains all the components used within the app.
|- Auth.js # Responsible for handling SignIn & SignOut.
|- Todos.js # Responsible for handling todos.
|- App.js
|- index.js