Skip to content

1sma31L/todo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple CRUD Todo list API using Go

This is a simple RESTful API for managing a todo list, built with Go. It allows you to create, read, update, and delete todos using go and postgresql (NEON)

Routes

  • GET /todos - Get all todos
  • GET /todos/id?id - Get a todo by ID (STUPID ROUTE I KNOW BUT I AM LAZY)
  • POST /todos - Create a new todo
  • PUT /todos - Update a todo
  • DELETE /todos?id - Delete a todo by ID

Usage

Just use POSTMAN to test the API. You can also use curl or any other HTTP client. e. g.

curl -X POST http://localhost:8080/todos -d '{"title": "Buy milk", "description": "BUY MILK AND DRINK IT" "completed": false}'

And yeah you can run it locally using go run main.go after adding your database connection string in a sparate .env file.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Languages