Skip to content

byBenPuls/cowboy_rest_api_example

Repository files navigation

Cowboy REST Demo

A minimal Erlang project demonstrating a clean REST API built with Cowboy. This repository provides a simple users API with standard CRUD operations and a lightweight frontend to interact with it.

Screenshots

Users Table

Users Table

Edit User

Edit User

Empty Table

Empty Table

Features

  • Users API

    • GET /api/v1/users — list all users
    • GET /api/v1/users/:id — get a single user
    • POST /api/v1/users — create a new user
    • PATCH /api/v1/users/:id — update an existing user
    • DELETE /api/v1/users/:id — delete a user
  • Frontend

    • Table view of all users
    • Detailed view for each user
    • Inline edit and delete actions
    • Minimal, modern design using vanilla HTML/CSS/JS
  • Error Handling

    • 404 Not Found page with JSON response

Tech Stack

  • Erlang
  • Cowboy (HTTP server)
  • EUnit for unit tests
  • PostgreSQL as database

How to Run

make deps
make compile
make tests

make run-local

Frontend is served statically via Cowboy. Navigate to /#/users to view users.

Built with vanilla HTML/CSS/JS. Powered by Cowboy.

Releases

No releases published

Packages

No packages published