Skip to content

Vennik/scala-micro-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 1, 2017
ef6e22e · Jan 1, 2017

History

13 Commits
Jan 1, 2017
Dec 22, 2016
Dec 22, 2016
Jan 1, 2017

Repository files navigation

Scala Micro Server

A simple Scala Micro Server. Routing can be done with regular expressions or literals.

Example

val contact: Regex = """\/contact(?:\/(.+))?""".r
new Server({
  case contact(int(id)) => "Contact int " + id
  case contact(str(name)) => "Contact string " + name
  case contact(_*) => "Contact nothing"
  case "/" => "Home"
}, 80)
object int {
  def unapply(s: String): Option[Int] = Try(s.toInt).toOption
}
object str {
  def unapply(s: String): Option[String] = Option(s)
}

About

Scala Micro Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages