Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 461 Bytes

example-usage.md

File metadata and controls

24 lines (18 loc) · 461 Bytes

Example usage

A simple application

import cats.effect.IO
import cats.syntax.show._
import com.github.ingarabr.http4s.Http4sCloudFunctionIOApp
import org.http4s._
import org.http4s.dsl._
import org.http4s.implicits._

class HelloFunction extends Http4sCloudFunctionIOApp with Http4sDsl[IO] {

  def routes: HttpApp[IO] =
    HttpRoutes
      .of[IO] {
        case req => Ok(show"Hello there.. ${req.method}")
      }
      .orNotFound

}