This project is hosted on https://todolistapi-kcjj.onrender.com
This is a backend for TodoList Web Apps on https://github.com/tobiasprima/todolist_react_web
- Clone
git clone https://github.com/tobiasprima/todolist_react_web
- Install Dependency
go mod tidy
- To test with Mongodb locally
-create new
.env
file and add:
DATABASE_URI = {YOUR_DATABASE_URI}
-run on localhost
go run main.go
- Test Endpoints on postman
http://localhost:8080/todos
http://localhost:8080/todo
with body
{
"title" : {INPUT_TITLE}
}
Status will default to false (Uncompleted)
http://localhost:8080/todo/{ID} // copy ID from get/todos method
This will create an order property for todos and it will automatically sorted in the get method
http://localhost:8080/todos/reorder
http://localhost:8080/todos/reset