Sinatra clone in Scala
github.com
github.com
I like how the HTML seems to be a first-class datatype in the example (is that a Scala thing? I'd better do some research):
get("/date/:year/:month/:day") {
<ul>
<li>Year: {params("year")}</li>
<li>Month: {params("month")}</li>
<li>Day: {params("day")}</li>
</ul>
}Actually - we can be able to implement our own methods get(), post(), etc. via pattern matching... So inspiring - on my way to fork it. ;)
At least half the magic of Sinatra is that you can write a single Ruby script, exec it and not have to fool around with build/generate/scaffold script or web server configuration to get something useful. It seems like you're pretty close, given that Java has no standard dependency retrieval system.
Microframeworks are appealing in that way: you can pick and choose which components to use, and they let you adapt MVC to whatever fits most naturally to your application. It's hard to argue with the brevity of the underlying code and the clarity of the example.
If it doesn't provide any option for separation that is bad, but for micro services it can be really nice.
It's not nearly as powerful as the real Sinatra, but it saves me the shenanigans of warbling Sinatra apps for servlet deployment.