NOTICE: This
learning
project has been completed β So I'm saying bye to it and archiving it! You can find my future projects on GitHub
This is a simple REST API for a Todo application. It supports retrieval, creation, modification and deletion of Todos.
It is written in Go and uses the Gin framework. I was trying to learn Go and this is my first project in Go.
It is deployed at go-todo-api-sa9e.onrender.com
You need to create a .env
file in the root directory of the project and add the following environment variables:
DATABASE_URL=<MongoDB Connection String>
DATABASE_NAME=<MongoDB Database Name>
Or you can set the environment variables directly.
Make sure that the MongoDB database is running and the connection string is correct. The database needs to have a collection named Todos
.
The easiest way to get started is to use Docker. You can pull the image from Dockerhub and run it using the following commands:
docker run -p 8080:8080 --env-file .env xkrishguptaa/go-todo-api
You can also build the API from source. You need to have Go installed on your system. You can then clone the repository and run the following commands:
go mod download
go mod verify
chmod +x ./scripts/build.sh
APP_NAME=go-todo-api ./scripts/build.sh
./bin/go-todo-api
The API documentation is available on Postman.
This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.