Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

sparsetech/trail

Routing library for the Scala platform

sparsetech/trail.json
{
"createdAt": "2015-12-10T16:35:27Z",
"defaultBranch": "master",
"description": "Routing library for the Scala platform",
"fullName": "sparsetech/trail",
"homepage": "",
"language": "Scala",
"name": "trail",
"pushedAt": "2022-05-04T08:26:56Z",
"stargazersCount": 82,
"topics": [
"router",
"scala",
"scala-native",
"scalajs",
"web-development",
"zero-dependency"
],
"updatedAt": "2024-06-13T15:11:01Z",
"url": "https://github.com/sparsetech/trail"
}

Build Status Join the chat at https://gitter.im/sparsetech/trail Maven Central

Trail is a routing library for Scala. It is available for the JVM, Scala.js and Scala Native.

  • 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
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"
}

Trail is licensed under the terms of the Apache v2.0 licence.

  • Tim Nieradzik
  • Darren Gibson
  • Anatolii Kmetiuk