A todo website just for testing golang web framework gin
Debian based(Ubuntu, Debian etc.) :
-
$ sudo apt-get update -
$ sudo apt-get install sqlite3RPM based(RHEL, CentOS, Fedora etc.) : -
$ sudo yum update -
$ sudo yum install sqlite
-
$ cp .env.example .env -
update the .env file with your DB url.
-
$ go get -
$ pip install pre-commit -
$ pre-commit install
$ make dev
$ make test
Gets all the todos. Response:
[{
id: int,
title: String,
description: String,
done: Boolean
}]Creates a new todo with default state (done : false). If the todo is sent without title or description the endpoint will return error message with status code 400 bad request.
Request:
{
title: String,
description: String,
}Response:
{
id: int,
title: String,
description: String,
done: false
}Gets a specific todo by it's id and returns 404 not found if the todo doesn't exist.
Response:
{
id: int,
title: String,
description: String,
done: Boolean
}Update specific todo Done status by Id and returns 404 not found if the todo doesn't exist.
Request:
{
done: Boolean
}Response:
{
id: int,
title: String,
description: String,
done: Boolean
}Delete specific todo by id and returns the deleted todo with Status code 204 No Content or 404 not found if the todo doesn't exist.
Response:
{
id: int,
title: String,
description: String,
done: Boolean
}