Skip to content

Commit

Permalink
Finch.io 0.2.0 is here
Browse files Browse the repository at this point in the history
  • Loading branch information
vkostyukov committed Dec 5, 2014
1 parent a99ec2e commit e304f59
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,42 @@
building composable REST APIs. Its mission is to provide the developers simple and robust REST API building blocks
being as close as possible to the Finagle bare metal API.

Modules
-------

**Finch.io** uses multi-project structure and contains of the following _modules_:

* `finch-core` - the core classes/functions
* `finch-json` - the lightweight and immutable JSON API
* `finch-demo` - the demo project
* `finch-jawn` - the [Jawn](https://github.com/non/jawn) library binding

Installation
------------
Every **Finch.io** module is published at Maven Central. Use the following _sbt_ snippet:

```scala
libraryDependencies ++= Seq(
"com.github.finagle" %% "finch-module" % "0.2.0"
)

```

Quickstart
----------

```scala
resolvers += "Finch.io" at "http://repo.konfettin.ru"

libraryDependencies ++= Seq(
"io" %% "finch" % "0.1.6"
"com.github.finagle" %% "finch-core" % "0.2.0",
"com.github.finagle" %% "finch-json" % "0.2.0"
)
```

```scala
def hello(name: String) = new Service[HttpRequest, HttpResponse] = {
def apply(req: HttpRequest) = for {
title <- OptionalParam("title")(req)
} yield Ok(s"Hello, ${title.getOrElse("")} $name!")
} yield Ok(Json.obj("greetings" -> s"Hello, ${title.getOrElse("")} $name!"))
}

val endpoint = new Endpoint[HttpRequest, HttpResponse] {
Expand Down
15 changes: 12 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sbt._
import sbt.Keys._
import com.typesafe.sbt.pgp.PgpKeys._
import scoverage.ScoverageSbtPlugin.instrumentSettings
import CoverallsPlugin.coverallsSettings

Expand All @@ -14,15 +15,23 @@ object Finch extends Build {
)

lazy val buildSettings = Seq(
organization := "io",
organization := "com.github.finagle",
version := "0.2.0",
scalaVersion := "2.10.4"
)

lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact := true,
publishTo := Some(Resolver.file("localDirectory", file(Path.userHome.absolutePath + "/repo"))),
useGpg := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://github.com/finagle/finch")),
pomExtra := (
Expand Down Expand Up @@ -77,5 +86,5 @@ object Finch extends Build {
id = "finch-jawn",
base = file("finch-jawn"),
settings = jawnSettings
) dependsOn(core)
) dependsOn core
}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.99.7.1")

addSbtPlugin("com.sksamuel.scoverage" %% "sbt-coveralls" % "0.0.5")

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")

0 comments on commit e304f59

Please sign in to comment.