Skip to content

Latest commit

 

History

History
129 lines (98 loc) · 2.56 KB

README.md

File metadata and controls

129 lines (98 loc) · 2.56 KB

Todo Backend API

A simple and efficient backend API for managing a Todo application built with Node.js, Express.js, and PostgreSQL.

Table of Contents

Features

  • Manage Todo items with CRUD operations.
  • RESTful API built with Node.js and Express.js.
  • PostgreSQL as the database.
  • CORS support for cross-origin requests.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone [email protected]:Vinayak-kumar-sharma/backend-todo-curd.git
    cd todo-backend
  2. Install dependencies :

    npm install 
  3. Set up the database:

    Create a PostgreSQL database.

    Update the DATABASE_URL in your environment variables.

  4. Run database migrations:

  5. Start the server:

Usage

After starting the server, the API will be available at ( http://localhost:PortNumber ). You can use tools like Postman to interact with the endpoints.

API Documentation

Endpoints

Todos

  • Get all Todos

    • GET /

    • Resposne:

      [
        {
          "id": 1,
          "title":"sample todo desc."
        }
      ]
  • Get a single Todo

    • GET /todo/:id

    • Response:

      {
        "id":1,
        "title":"sample todo desc."
      }
  • Create a Todo

    • POST /todo
    • Request:
      {
        "title":"New todo"
      }
  • Update a Todo

    • PUT /todos/:id
    • Request
      {
        "title":"Updated todo"
      }
  • Delete a Todo

    • DELETE /todo/:id
    • Response:
      {
        "message": "Todo was deleted!"
      }

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

  1. Fork the repository.

  2. Create a new branch ( git checkout -b branch-name ) .

  3. Commit your changes ( git commit -m 'Add some feature' ).

  4. Push to the branch ( git push origin branch-name ).

  5. Open a pull request.

Contact

Feel free to give your valuable feedback:

  • GitHub: Vinayak-kumar-sharma

Happy Codding 🚀