port: 6379 } // Config.scala case class Config(redis: RedisConfig) case class RedisConfig(host: String, port: Int) val confPath = ConfigFactory.load(“development.conf”) val config = loadConfig[Config](confPath).get assert(config.redis.host == “127.0.0.1”) assert(config.redis.port == 6379)
= get(“user” :: int) { userId: Int => val user: User = User.getById(userId) user } val createUser: Endpoint[Boolean] = post(“user” :: jsonBody[User]) { user: User => // create user true } Http.server.serve(“:80”, (getUser :+: createUser).toService)