Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/albertsmit/marlin

A Nim port of Lukeed's Trouter 🐟.
https://github.com/albertsmit/marlin

lukeed nim router trouter

Last synced: about 1 month ago
JSON representation

A Nim port of Lukeed's Trouter 🐟.

Awesome Lists containing this project

README

        

![Language: Nim](https://img.shields.io/static/v1?label=written%20with%20love,%20in&message=Nim&color=yellow)
![License: MIT](https://img.shields.io/github/license/AlbertSmit/Marlin)
[![Version](https://img.shields.io/github/v/release/AlbertSmit/Marlin?include_prereleases)](https://github.com/AlbertSmit/Marlin/releases)

# Marlin 🦈

> Marlins are among the fastest marine swimmers [` 1 `](#footnote)

> ...greatly exaggerated speeds are often claimed in popular literature [` 1 `](#footnote)

**`1`** — Source: [Wikipedia](https://en.wikipedia.org/wiki/Marlin)

## What the fish is this?

**A [Nim](https://github.com/nim-lang/Nim) port of [Lukeed](https://github.com/lukeed)'s [Trouter 🐟](https://github.com/lukeed/regexparam).**

> Long story short; it's a _router_.

Writing this port to
- understand the inner workings
- get better at writing libraries
- have a shiny new router to work with

_Work in progress._

## Usage
```nim
import marlin, std/with, sugar

with marlin.router:
get "/pizza", () => "pizza is ready!"
get "/hamburger", () => "who ordered a hamburger?"
get "/songs/:artist/reviews/:song?", () => "bruh"
post "/songs/:artist/:album", () => "mister postman."
```

## Submodules

- `src/regex` → Nim port of [Lukeed](https://github.com/lukeed)'s `RegexParams`.