Unfiltered on Heroku
Heroku 㧠Scala ããµãã¼ããããã®ã§ Unfiltered ãåããã¦ã¿ã¾ããã
https://github.com/akr4/heroku-unfiltered
package net.physalis.herokuunfiltered import unfiltered.request._ import unfiltered.response._ import unfiltered.netty._ import util.Properties import grizzled.slf4j.Logging object Hello extends cycle.Plan with cycle.ThreadPool with ServerErrorResponse with Logging { def intent = { case Path(Seg("hello" :: Nil)) & Params(params) => { debug(params) ResponseString("Hello %s".format(params("name").headOption.getOrElse("Unfiltered"))) } case Path(_) => ResponseString("Hello from Unfiltered!") } } object Main extends App with Logging { val port = Properties.envOrElse("PORT", "8080").toInt info("started on port:%d".format(port)) unfiltered.netty.Http(port).plan(Hello).run() }
Netty ãã¤ã³ãã£ã³ã°ã使ãã¾ããã
ãªãã¹ã³ãããã¼ãã
Properties.envOrElse("PORT","8080")
ã§åå¾ããã®ããã¤ã³ãã®ããã§ãã
Scala on Heroku ã«ã¤ãã¦ã¯ãã¡ããåèã«ãªãã¾ãã
http://devcenter.heroku.com/articles/scala
git push ããããããã¤ã§ãããç°¡åã§ããã§ããã¼ã