Welcome to the Todo Server, a simple and efficient application built with Express, TypeScript, and MongoDB to manage your tasks seamlessly. This server provides a robust backend for your todo application, allowing you to focus on creating a delightful user experience.
Make sure you have the following installed on your system:
-
Clone the repository:
git clone https://github.com/luke-dowling/todo-server-ts.git
-
Navigate to the project directory:
cd todo-server
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory of the project and configure the following variables:PORT=8000 DB=mongo-uri DB_PASSWORD=mongo-uri-password
Adjust the values as needed.
Start the server using the following command:
npm start
The server will be running at http://localhost:8000
by default.
- Endpoint:
/
- Method: GET
- Description: Get a list of all routes.
- Endpoint:
/todos
- Method: GET
- Description: Get a list of all todos.
- Endpoint:
/todos/:id
- Method: GET
- Description: Get a specific todo by its ID.
- Endpoint:
/todos
- Method: POST
- Description: Create a new todo.
- Request Body:
{ "text": "Sample Todo" }
- Endpoint:
/todos/:id
- Method: PUT
- Description: Update a todo by its ID.
- Request Body:
{ "text": "Updated Todo", "completed": true }
- Endpoint:
/todos/:id
- Method: DELETE
- Description: Delete a todo by its ID.
We welcome and encourage contributions from the community. To contribute to the development of this project:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
. - Make your changes and commit them:
git commit -m "Description of changes"
. - Push your changes to the branch:
git push origin feature-name
. - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to reach out if you have any questions or need assistance. Happy coding </>