pddg / go-sample-todo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-sample-todo

This is a simple todo list application written in Go.

Getting Started

Prerequisites

  • Go 1.22 or later

Installation

go get github.com/pddg/go-sample-todo

Usage

Running in-memory mode. This mode does not require any database.

./go-sample-todo -in-memory

Running with MySQL.

./go-sample-todo -mysql-host=localhost -mysql-port=3306 -mysql-user=root -mysql-password=root

Endpoints

GET /todo

Get all todos.

curl -X GET http://localhost:8080/todo

POST /todo

Create a new todo.

curl -X POST -H "Content-Type: application/json" -d '{"task": "Buy milk"}' http://localhost:8080/todo

DELETE /todo/:id

Delete a todo.

curl -X DELETE http://localhost:8080/todo/1

Author

  • pddg

About


Languages

Language:Go 89.5%Language:Makefile 8.0%Language:Shell 2.4%