/gleam-todo

TODO app built with gleam

Primary LanguageGleam

todo_app

Day 1 of using gleam. A simple TODO HTTP API application.

Package Version Hex Docs

gleam add todo_app
import todo_app

pub fn main() {
  // TODO: An example of the project in use
}

Further documentation can be found at https://hexdocs.pm/todo_app.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

Run some commands:

Create a new todo

curl -X POST \
  http://localhost:8080/todos \
  -H 'Content-Type: application/json' \
  -d '{"message":"my new todo"}' 

update a todo

curl -X PUT \ 
  http://localhost:8080/todos/0 \
  -H 'Content-Type: application/json' \
  -d '{"message":"first"}'

delete a todo

curl -X DELETE http://localhost:8080/todos/0

get all todos

curl http://localhost:8080/todos

get a todo by its ID

curl http://localhost:8080/todos/0