Skip to content

Benevanio/task-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task App

A simple task management application built with Node.js, Express, and MongoDB.

Getting Started

To get started with this project, follow these steps:

  1. Clone the repository:
git clone https://github.com/Benevanio/task-app.git
  1. Install dependencies:
cd task-app
npm install
  1. Create a .env file in the root directory and add your MongoDB connection URL and port:
MONGO_URL=<your_mongodb_connection_url>
PORT=<your_desired_port>
  1. Start the server:
npm start

Now you can access the application at http://localhost:<your_desired_port>.

API Endpoints

The following API endpoints are available:

  • GET /: Returns a welcome message.
  • POST /tasks: Creates a new task.
  • GET /tasks: Retrieves all tasks.
  • GET /tasks/:id: Retrieves a specific task by ID.
  • PATCH /tasks/:id: Updates a specific task by ID.
  • DELETE /tasks/:id: Deletes a specific task by ID.

Example Usage

To create a new task, send a POST request to http://localhost:<your_desired_port>/tasks with the following JSON payload:

{
  "description": "Complete the task app",
  "completed": false
}

To retrieve all tasks, send a GET request to http://localhost:<your_desired_port>/tasks.

To retrieve a specific task by ID, send a GET request to http://localhost:<your_desired_port>/tasks/:id.

To update a specific task by ID, send a PATCH request to http://localhost:<your_desired_port>/tasks/:id with the updated JSON payload.

To delete a specific task by ID, send a DELETE request to http://localhost:<your_desired_port>/tasks/:id.

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

This project was built as part of a Node.js course.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published