Skip to content

tobiasprima/todolistapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang ToDoList Restful API with MongoDB Database

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

Quick Start

  1. Clone
git clone https://github.com/tobiasprima/todolist_react_web
  1. Install Dependency
go mod tidy
  1. To test with Mongodb locally -create new .env file and add:
DATABASE_URI = {YOUR_DATABASE_URI}

-run on localhost

go run main.go
  1. Test Endpoints on postman

get todos (GET)

http://localhost:8080/todos

create new todo (POST)

http://localhost:8080/todo

with body

{
  "title" : {INPUT_TITLE}
}

Status will default to false (Uncompleted)

update todo status (PATCH)

http://localhost:8080/todo/{ID}   // copy ID from get/todos method

reorder todo based on status (PATCH)

This will create an order property for todos and it will automatically sorted in the get method

http://localhost:8080/todos/reorder

reset todo order (POST)

http://localhost:8080/todos/reset

Releases

No releases published

Packages

No packages published

Languages