Created
August 8, 2011 03:40
-
-
Save jugyo/1131168 to your computer and use it in GitHub Desktop.
unfiltered-netty example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sbts | |
!# | |
// You can install the sbts by conscript: cs jugyo/sbts | |
/*** | |
libraryDependencies ++= Seq( | |
"net.databinder" %% "unfiltered-netty" % "0.4.1" | |
) | |
*/ | |
import unfiltered.request._ | |
import unfiltered.response._ | |
/** unfiltered plan */ | |
class App extends unfiltered.netty.cycle.Plan { | |
def intent = { | |
case GET(Path(p)) => Html( | |
<html> | |
<body> | |
<p>foo</p> | |
</body> | |
</html> | |
) | |
} | |
} | |
/** embedded server */ | |
unfiltered.netty.Http(8080).handler(new App).run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment