Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparsetech/trail
Routing library for the Scala platform
https://github.com/sparsetech/trail
router scala scala-native scalajs web-development zero-dependency
Last synced: about 2 months ago
JSON representation
Routing library for the Scala platform
- Host: GitHub
- URL: https://github.com/sparsetech/trail
- Owner: sparsetech
- Created: 2015-12-10T16:35:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-05-04T08:26:56.000Z (over 2 years ago)
- Last Synced: 2024-08-04T00:05:36.625Z (5 months ago)
- Topics: router, scala, scala-native, scalajs, web-development, zero-dependency
- Language: Scala
- Homepage:
- Size: 182 KB
- Stars: 82
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-scala-native - Trail - Routing library. (Web Development)
README
#
[![Build Status](https://travis-ci.org/sparsetech/trail.svg)](https://travis-ci.org/sparsetech/trail)
[![Join the chat at https://gitter.im/sparsetech/trail](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sparsetech/trail?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Maven Central](https://img.shields.io/maven-central/v/tech.sparse/trail_2.13.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22tech.sparse%22%20AND%20a%3A%22trail_2.13%22)Trail is a routing library for Scala. It is available for the JVM, Scala.js and Scala Native.
## Features
* Define type-safe routes
* Parse and generate URLs
* DSL to extract path elements, arguments and fragments
* Express routing tables via pattern matching
* Define custom codecs
* IDE support
* Cross-platform support (JVM, Scala.js, Scala Native)
* Zero dependencies## Example
```scala
import trail._val details = Root / "details" / Arg[Int]
val userInfo = Root / "user" / Arg[String] & Param[Boolean]("show")val result = "/user/hello?show=false" match {
case details (a) => s"details: $a"
case userInfo((u, s)) => s"user: $u, show: $s"
}
```## Links
* [Documentation](http://sparse.tech/docs/trail.html)
* [ScalaDoc](https://www.javadoc.io/doc/tech.sparse/trail_2.13/)## Licence
Trail is licensed under the terms of the Apache v2.0 licence.## Authors
* Tim Nieradzik
* Darren Gibson
* Anatolii Kmetiuk