aboutsummaryrefslogtreecommitdiff
path: root/content/post/2012-11-07-announcing-finatra-1-0-0.markdown
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2018-11-06 03:03:41 +0000
committerJulio Capote <jcapote@gmail.com>2018-11-06 03:03:41 +0000
commit4b489a049a0063bbb1fd9f0c0f74ce1ee9f87a86 (patch)
tree98af5707e30150af482e297bed9cd4e9b5477e6a /content/post/2012-11-07-announcing-finatra-1-0-0.markdown
parenta62a3e7755579d93ce3a87243dd277575930fffe (diff)
downloadcapotej.com-4b489a049a0063bbb1fd9f0c0f74ce1ee9f87a86.tar.gz
import old posts
Diffstat (limited to 'content/post/2012-11-07-announcing-finatra-1-0-0.markdown')
-rw-r--r--content/post/2012-11-07-announcing-finatra-1-0-0.markdown72
1 files changed, 72 insertions, 0 deletions
diff --git a/content/post/2012-11-07-announcing-finatra-1-0-0.markdown b/content/post/2012-11-07-announcing-finatra-1-0-0.markdown
new file mode 100644
index 0000000..5507b1a
--- /dev/null
+++ b/content/post/2012-11-07-announcing-finatra-1-0-0.markdown
@@ -0,0 +1,72 @@
+---
+layout: post
+title: "announcing finatra 1.0.0"
+date: 2012-11-07T21:20:00Z
+comments: true
+categories: ["finatra", "scala"]
+---
+
+After months of work [Finatra](https://github.com/capotej/finatra#readme) 1.0.0 is finally available! Finatra is a scala web framework inspired by [Sinatra](https://github.com/sinatra/sinatra#readme) built on top of [Finagle](http://twitter.github.com/finagle).
+
+### The API
+
+The API looks like what you'd expect, here's a simple endpoint that uses route parameters:
+
+```scala
+get("/user/:username") { request =>
+ val username = request.routeParams.getOrElse("username", "default_user")
+ render.plain("hello " + username).toFuture
+}
+```
+
+The ```toFuture``` call means that the response is actually a [Future](http://twitter.github.com/scala_school/finagle.html#Future), a powerful concurrency abstraction worth checking out.
+
+Testing it is just as easy:
+
+```scala
+"GET /user/foo" should "responsd with hello foo" in {
+ get("/user/foo")
+ response.body should equal ("hello foo")
+}
+```
+
+### A super quick demo
+
+```sh
+$ git clone https://github.com/capotej/finatra.git
+$ cd finatra
+$ ./finatra new com.example.myapp /tmp
+```
+
+Now you have an ```/tmp/myapp``` you can use:
+
+```sh
+
+$ cd /tmp/myapp
+$ mvn scala:run
+```
+
+A simple app should've started up locally on port 7070, verify with:
+
+```sh
+$ curl http://locahost:7070
+hello world
+```
+
+You can see the rest of the endpoints at ```/tmp/myapp/src/main/scala/com/example/myapp/App.scala```
+
+### Heroku integration
+
+The generated apps work in heroku out of the box:
+
+```sh
+$ heroku create
+$ git init
+$ git add .
+$ git commit -am 'stuff'
+$ git push heroku master
+```
+
+Make sure to see the full details in the [README](https://github.com/capotej/finatra#readme) and check out the [example app](https://github.com/capotej/finatra-example).
+
+Props to [@twoism](http://twitter.com/twoism) and [@thisisfranklin](http://twitter.com/thisisfranklin) for their code, feedback and moral support.