Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.34 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.34 KB

Raxx.ApiBlueprint

Raxx middleware for routing requests based on an API Blueprint.

Hex pm Build Status License

Getting started

Define a blueprint for your application.

FORMAT: 1A

# Messages [/messages]
## Create a message [POST]

lib/my_app/www.apib

Use the Raxx.ApiBlueprint in a Raxx.Server module.

defmodule MyApp.WWW do
  use Raxx.Server
  use Raxx.ApiBlueprint, "./www.apib"
end

lib/my_app/www.ex

Add controller modules for each action in the blueprint. Controller modules are just another Raxx.Server

defmodule MyApp.WWW.CreateAMessage do
  use Raxx.Server

  @impl Raxx.Server
  def handle_request(request, state) do
  # ...
end

lib/my_app/www/create_a_message.ex