Skip to content

Commit 6a8e306

Browse files
authored
Merge pull request #33 from geotrellis/feature/http4s-0.19
Bump http4s for cats compatibility
2 parents 632d27e + 6e99344 commit 6a8e306

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ responsive layers whose transformations can be described in MAML
1515
### Including Geotrellis Server
1616

1717
Current version:
18-
- 0.0.2
18+
- 0.0.4
1919

20-
`libraryDependencies += "com.azavea" %% "geotrellis-server-core" % "0.0.2"`
20+
Add the geotrellis-server dependency by declaring it within your
21+
project's `build.sbt`:
22+
`libraryDependencies += "com.azavea" %% "geotrellis-server-core" % "0.0.4"`
2123

2224

2325
### Running an example

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ scalaVersion in ThisBuild := scalaVer
66

77
lazy val commonSettings = Seq(
88
organization := "com.azavea",
9-
version := "0.0.3",
9+
version := "0.0.4",
1010
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
1111
cancelable in Global := true,
1212
scalaVersion := scalaVer,

example/src/main/scala/geotrellis/server/example/ndvi/NdviServer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import cats.effect._
1111
import io.circe._
1212
import io.circe.syntax._
1313
import fs2._
14-
import fs2.StreamApp.ExitCode
1514
import org.http4s.circe._
1615
import org.http4s._
1716
import org.http4s.dsl.Http4sDsl
@@ -28,7 +27,7 @@ import scala.collection.mutable
2827
import java.util.UUID
2928

3029

31-
object NdviServer extends StreamApp[IO] with LazyLogging with Http4sDsl[IO] {
30+
object NdviServer extends LazyLogging with Http4sDsl[IO] {
3231

3332
implicit val contextShift: ContextShift[IO] = IO.contextShift(global)
3433

example/src/main/scala/geotrellis/server/example/ndvi/NdviService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class NdviService[Param](
6666

6767
final val eval = MamlTms.curried(ndvi, interpreter)
6868

69-
def routes: HttpService[IO] = HttpService[IO] {
69+
def routes: HttpRoutes[IO] = HttpRoutes.of {
7070
// Matching json in the query parameter is a bad idea.
7171
case req @ GET -> Root / IntVar(z) / IntVar(x) / IntVar(y) ~ "png" :? RedQueryParamMatcher(red) +& NirQueryParamMatcher(nir) =>
7272
val paramMap = Map("red" -> red, "nir" -> nir)

example/src/main/scala/geotrellis/server/example/overlay/WeightedOverlayServer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import cats.effect._
1111
import io.circe._
1212
import io.circe.syntax._
1313
import fs2._
14-
import fs2.StreamApp.ExitCode
1514
import org.http4s.circe._
1615
import org.http4s._
1716
import org.http4s.dsl.Http4sDsl
@@ -29,7 +28,7 @@ import scala.collection.mutable
2928
import java.util.UUID
3029

3130

32-
object WeightedOverlayServer extends StreamApp[IO] with LazyLogging with Http4sDsl[IO] {
31+
object WeightedOverlayServer extends LazyLogging with Http4sDsl[IO] {
3332

3433
implicit val contextShift: ContextShift[IO] = IO.contextShift(global)
3534

example/src/main/scala/geotrellis/server/example/overlay/WeightedOverlayService.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import java.net.URI
3232
import java.util.{UUID, NoSuchElementException}
3333
import scala.util.Try
3434
import scala.collection.mutable
35+
import scala.concurrent.ExecutionContext
3536

3637

3738
class WeightedOverlayService(
@@ -91,13 +92,13 @@ class WeightedOverlayService(
9192
}
9293
}
9394

94-
def routes: HttpService[IO] = HttpService[IO] {
95+
def routes: HttpRoutes[IO] = HttpRoutes.of {
9596
// Handle the static files for this demo
9697
case request @ GET -> Root =>
97-
StaticFile.fromResource("/overlay-demo/index.html", Some(request)).getOrElseF(NotFound())
98+
StaticFile.fromResource("/overlay-demo/index.html", ExecutionContext.global, Some(request)).getOrElseF(NotFound())
9899

99100
case request @ GET -> Root / path if List(".js", ".css", ".map", ".html", ".webm").exists(path.endsWith) =>
100-
StaticFile.fromResource("/overlay-demo/" + path, Some(request)).getOrElseF(NotFound())
101+
StaticFile.fromResource("/overlay-demo/" + path, ExecutionContext.global, Some(request)).getOrElseF(NotFound())
101102

102103
case req @ POST -> Root / IdVar(key) =>
103104
(for {

example/src/main/scala/geotrellis/server/example/persistence/PersistenceServer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import cats.effect._
1111
import io.circe._
1212
import io.circe.syntax._
1313
import fs2._
14-
import fs2.StreamApp.ExitCode
1514
import org.http4s.circe._
1615
import org.http4s._
1716
import org.http4s.dsl.Http4sDsl
@@ -29,7 +28,7 @@ import scala.collection.mutable
2928
import java.util.UUID
3029

3130

32-
object PersistenceServer extends StreamApp[IO] with LazyLogging with Http4sDsl[IO] {
31+
object PersistenceServer extends LazyLogging with Http4sDsl[IO] {
3332

3433
implicit val contextShift: ContextShift[IO] = IO.contextShift(global)
3534

example/src/main/scala/geotrellis/server/example/persistence/PersistenceService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PersistenceService[Store, Param](
5656

5757
implicit val expressionDecoder = jsonOf[IO, Expression]
5858

59-
def routes = HttpService[IO] {
59+
def routes: HttpRoutes[IO] = HttpRoutes.of {
6060
case req @ POST -> Root / IdVar(key) =>
6161
(for {
6262
expr <- req.as[Expression]

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Dependencies {
44

55
val circeVer = "0.10.0"
66
val gtVer = "2.0.0"
7-
val http4sVer = "0.18.12"
7+
val http4sVer = "0.19.0-M3"
88
val scalaVer = "2.11.12"
99
val tsecV = "0.0.1-M11"
1010

0 commit comments

Comments
 (0)