Web Framework for Scala inspired by Play Framework.
Status: PoC
$ sbt root/publishLocal
$ sbt plugin/publishLocal
project/plugins.sbt
addSbtPlugin("dev.aoiroaoino" % "monoton-plugin" % "0.1.0-SNAPSHOT")
build.sbt
lazy val root = (project in file("."))
.enablePlugins(MonotonPlugin)
$ sbt docs/makeMicrosite
$ cd docs/target/site
$ jekyll serve
$ sbt run
$ curl -i http://localhost:8080
HTTP/1.1 200 OK
content-type: text/html
content-length: 24
connection: close
<h1>Hello, Monoton!</h1>
[root]/example/controllers/StatusController.scala
:
package example.controllers
import monoton.http.Response
import monoton.server.Controller
class StatusController extends Controller {
def ping: RequestHandler = HandlerBuilder.pure(Ok("pong"))
}
[root]/example/MyRouter.scala
:
[root]/AppModule.scala
:
import com.google.inject.AbstractModule
import monoton.server.Router
class AppModule extends AbstractModule {
override def configure(): Unit = {
bind(classOf[Router]).to(classOf[example.MyRouter])
}
}
$ sbt run
$ curl -i http://localhost:8080/ping
HTTP/1.1 200 OK
content-type: text/plain
content-length: 4
connection: close
pong