Giter Site home page Giter Site logo

todo-api's Introduction

Todo API

This is a RESTful API that allows you to manage your todo list. The API has endpoints for creating, updating, deleting and retrieving todos.

Requirements To run this application, you will need:

Node.js npm or yarn package manager Installation To install the dependencies, run the following command:

bash Copy code npm install Configuration You will need to set up a .env file in the root directory of the project with the port environment variable:

PORT: The port that the server should run on

bash Copy code PORT=5000 //localhost:5000/api/v1/todo Running the application To start the server, run the following command:

bash Copy code npm start This will start the server on the port specified in the .env file.

API Endpoints The following endpoints are available:

GET /get-single/:id: Get a list of all todos GET /get-all-todos: Get a single todo by ID POST /add-todo: Create a new todo PUT /update-todo/:id: Update a todo by ID DELETE /delete-todo/:id: Delete a todo by ID User Management System To extend the API to support a user management system where each user can access their own todo, you could add the following endpoints:

POST /users: Create a new user GET /users/:id/todos: Get a list of all todos for a specific user GET /users/:id/todos/:todoId: Get a single todo by ID for a specific user POST /users/:id/todos: Create a new todo for a specific user PUT /users/:id/todos/:todoId: Update a todo by ID for a specific user DELETE /users/:id/todos/:todoId: Delete a todo by ID for a specific user To implement this, you would need to add a userId field to the Todo schema and use it to filter todos based on the authenticated user's ID. You would also need to implement authentication and authorization to ensure that each user can only access their own todos.

todo-api's People

Watchers

Jane Stack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.