Categorygithub.com/htanmo/todoapi
repositorypackage
0.0.0-20240724114954-cda4f1352581
Repository: https://github.com/htanmo/todoapi.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

Todoapi

A simple REST API for todo applications.

Endpoints

Base URL

http://localhost:8080/api

By default the todoapi uses port 8080 you can set a different port using PORT Environment variable.

API Endpoints

MethodEndpointDescription
GET/todoReturn all available todos
POST/todoCreate a new todo
GET/todo/{id}Return a specific todo
PUT/todo/{id}Edit a specific todo
DELETE/todo/{id}Delete a specific todo

Building the Project

Default path to store the database is todo.db you can set a custom database name and path to store the database using the DB_URI environment variable.

Justfile (Recommended)

Builds the server executable under bin/ directory and also runs the server.

just run

Manually

Build Server

go build -o bin/

Run Server

./bin/todoapi