Crolite

Lightweight Cro routing + tiny CLI wrapper

NAME

Crolite - Lightweight Cro routing + tiny CLI wrapper

SYNOPSIS

use Crolite;

get -> $a {          # /<anything>
    content 'text/plain', 'worked';
}

delete -> 'something', Int $var {   # /something/<int>
    content 'application/json', %( :$var );
}

List routes:

raku example.raku routes

Run a dev server:

raku example.raku daemon --port=3000

Test a route ad-hoc:

raku example.raku GET /something/42

DESCRIPTION

Crolite removes boilerplate when hacking together small Cro HTTP examples. Importing it allocates a fresh Cro::HTTP::Router::RouteSet (stored in PROCESS scope) and exports the usual Cro routing helpers along with a multi MAIN providing:

  • routes — print collected endpoint signatures.

  • daemon — start a Cro::HTTP::Server with your route set (Ctrl+C to stop).

  • GET|POST|PUT|DELETE <path> — perform a single in-memory request using Cro::HTTP::Test.

  • http <path> --method=<verb> — generic form accepting any method string.

Goals

  • Rapid prototyping / teaching.

  • Introspection of defined routes without extra code.

  • Preserve native Cro primitives (no bespoke DSL).

Caveats

  • Early sketch; API may shift.

  • Thin error handling; exceptions surface directly.

  • Not a full project scaffold (logging/TLS/config left to Cro proper).

AUTHOR

Fernando CorrĂȘa de Oliveira [email protected]

COPYRIGHT AND LICENSE

Copyright 2025 Fernando CorrĂȘa de Oliveira

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Crolite v0.0.1

Lightweight Cro routing + tiny CLI wrapper

Authors

  • Fernando CorrĂȘa de Oliveira

License

Artistic-2.0

Dependencies

CroCro::HTTP::RouterUtilsCro::HTTP

Test Dependencies

Provides

  • Crolite

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.