3 ms·
Is the whole thing really just the one file (110 lines)? http://github.com/alandipert/step/blob/42cee9ecd360205def359ce2719f34120edee499/src/main/scala/Step.sca
by 10ren 17y ago
Is the whole thing really just the one file (110 lines)? http://github.com/alandipert/step/blob/42cee9ecd360205def359ce2719f34120edee499/src/main/scala/Step.scala http://github.com/alandipert/step/blob/42cee9ecd360205def359...
I know it describes itself as "tiny", and sinatra is also tiny, but that seems... small. (I don't know anything about Scala - is it especially concise?)
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>
}
- wooby 17y agoYeah it's pretty small. With Scala you basically get free HTML templating because of XML literal support. It's missing a lot of Sinatra stuff though: 'splat' and regex URI pattern matching, file uploads, sessions...
- vladev 17y agoMaybe leveraging pattern matching could improve. Actually - we can be able to implement our own methods get(), post(), etc. via pattern matching... So inspiring - on my way to fork it. ;)
- deleted 17y ago[deleted]
- deleted 17y ago[deleted]