Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created September 15, 2011 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/1219321 to your computer and use it in GitHub Desktop.
Save xuwei-k/1219321 to your computer and use it in GitHub Desktop.
"hello" を返すだけのサーバーを unfiltered で !

これ http://blog.twiwt.org/e/f835d9 がインストールされていれば、ファイルを保存して、実行権限与えておいて

./unfiltered-sample.scala

ってやるだけでローカルで、勝手に空いてるポートで、"hello" を返すだけのサーバー起動するお( ^ω^)

終了は、コンソールでなにかキーを入力すればいいはず

#!/usr/bin/env xsbtscript
!#
/***
libraryDependencies ++= Seq(
"net.databinder" %% "unfiltered-jetty" % "0.5.0"
,"net.databinder" %% "unfiltered-filter" % "0.5.0"
)
*/
unfiltered.jetty.Http.anylocal.filter(new unfiltered.filter.Plan{def intent={case _=>unfiltered.response.ResponseString("hello")}}).run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment