![Logo](https://raw.githubusercontent.com/uloamaka/Todo_Apis/main/images/logo.png)
A complete Todo Apis, this api allows you to create todo task, read, update and delete todo task.
It handle authentication of user, allowing only authenticated user to create and access todo task
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
![Product Name Screen Shot][product-screenshot]
Here's a blank template to get started: To avoid retyping too much info. Do a search and replace with your text editor for the following: github_username
, repo_name
, twitter_handle
, linkedin_username
, email_client
, email
, project_title
, project_description
- [![Node][Node.js]][https://nodejs.org/]
- [![Express][Express.com]][https://expressjs.com/]
- [![MongoDb][mongodb.com]][https://www.mongodb.com/]
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
- Node (https://nodejs.org/)
- mongodb (https://www.mongodb.com/)
- Git (https://git-scm.com/downloads)
- npm
npm install npm@latest -g
- Get API Key at env_example.md, change to your own KEY
- Clone the repo
git clone https://github.com/<your_github_username>/Todo_Apis.git
- Install NPM packages
npm install
- Enter your API in
.env
const API_KEY = 'ENTER YOUR API';
This function is used to send a successful response (HTTP status code 200) with a payload and optional metadata. The payload
parameter represents the data to be sent in the response body, while the meta
parameter is an optional object containing additional information about the response e.g pagination data.
Use this function to send a response indicating that a resource has been successfully created (HTTP status code 201). The payload
parameter represents the data of the newly created resource.
This function sends a response with no content (HTTP status code 204). It is typically used for successful requests that do not require a response body.
Instead of using res.error
directly, this template encourages the use of custom error classes for handling and responding to errors. These classes simplify error handling by providing consistent error structures and HTTP status codes. The following custom error classes are available:
BadRequest
: Represents a 400 Bad Request error. It takes amessage
parameter as the error message and an optionalerrorCode
parameter to identify the specific error.Unauthorized
: Represents a 401 Unauthorized error. It takes amessage
parameter as the error message and an optionalerrorCode
parameter.Forbidden
: Represents a 403 Forbidden error. It takes amessage
parameter as the error message and an optionalerrorCode
parameter.
To throw one of these custom errors, simply create a new instance of the appropriate error class and throw it with the desired error message and error code.
A list of all error codes can be found in the httpErrorCode.js
file. This file provides a comprehensive collection of HTTP status codes and their corresponding error codes. You can refer to this file to find the appropriate error code when throwing a custom error.
The following npm commands are available for managing and running the Express application:
-
npm run dev
: Starts the development server. This command is used during the development process to run the application with automatic reloading on code changes. -
npm start
: Starts the production server. This command is used to run the application in a production environment.
Feel free to modify and use these commands according to your specific application needs.
For more examples, please refer to the Documentation
- Authentication
- Todo task
- full CRUD
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Your Name - @ebitegift235 - ebitegift235@gmail.com
Project Link: https://github.com/uloamaka/Todo_Apis