Skip to content
This repository has been archived by the owner on May 27, 2018. It is now read-only.

Latest commit

 

History

History
34 lines (24 loc) · 863 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 863 Bytes

URI Route Trie

Build Status License

High performance URI router based on radix trie structure.

Add to project

Add resolvers to your build.sbt

resolvers += Resolver.bintrayRepo("fcomb", "maven")

Add dependencies to your build.sbt

libraryDependencies += "io.fcomb" %% "route-trie" % "0.4.0"

Usage

import io.fcomb.trie.RouteTrie
import io.fcomb.trie.RouteMethods._

val tree = RouteTrie[Int](
  "/users" -> (GET, 1),
  "/users/:id" -> (GET, 2),
  "/files/*file" -> (POST, 3)
)
tree.get(GET, "/users/12") // will return Some((2, Some(OpenHashMap("id" -> "12"))))