Fosi Fossil Service
Small teams. Open source. Built on Fossil.

CaaS / Lamina

Unified Management for Fossil Repositories

Public | Owner: CaaS | Default branch: trunk | Last update: 2026-10-25 00:41

Artifact 66d6a3053ae18f4a91bbf8f70a7d9a2f2f9b472cf400386e6fd3c3234e732102:


-module(nova_test_app_controller).

-export([
         index/1,
         json/1,
         echo/1,
         literal/1,
         method/1,
         redirect/1,
         teapot/1,
         crash/1,
         extra/1,
         secret/1,
         auth_data/1,
         host/1,
         not_found/1
        ]).

index(_Req) ->
    {status, 200, #{<<"content-type">> => <<"text/plain">>}, <<"index">>}.

json(_Req) ->
    {json, #{ok => true, from => <<"nova_test_app">>}}.

echo(#{bindings := Bindings}) ->
    {json, Bindings}.

literal(_Req) ->
    {json, #{matched => <<"literal">>}}.

method(#{method := Method}) ->
    {json, #{method => Method}}.

redirect(_Req) ->
    {redirect, "/json"}.

teapot(_Req) ->
    {status, 418, #{}, <<"short and stout">>}.

crash(_Req) ->
    erlang:error(deliberate_crash).

extra(#{extra_state := ExtraState}) ->
    {json, #{answer => maps:get(answer, ExtraState, undefined)}}.

secret(_Req) ->
    {json, #{secret => true}}.

auth_data(#{auth_data := AuthData}) ->
    {json, AuthData}.

host(_Req) ->
    {json, #{host_scoped => true}}.

not_found(_Req) ->
    {status, 404, #{<<"content-type">> => <<"text/plain">>}, <<"custom not found">>}.

Clone

You can clone this repository with the following command:

fossil clone https://fosi.dev/CaaS/Lamina

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.