-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFitmanAppGet.scala
30 lines (23 loc) · 924 Bytes
/
FitmanAppGet.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.twitter.server
// https://shekhargulati.com/2017/09/14/finatra-tutorial-building-scalable-services-the-twitter-way/
// test the API via :
// curl localhost:8080/hello
// curl localhost:8080/wazzup
import com.twitter.finagle.http.Request
import com.twitter.finatra.http.routing.HttpRouter
import com.twitter.finatra.http.{Controller, HttpServer}
object FitmanAppGet extends FitmanServer2
class FitmanServer2 extends HttpServer {
override protected def defaultHttpsPort: String = ":8080"
override protected def defaultHttpServerName: String = "FitMan"
override protected def configureHttp(router: HttpRouter) {
router.add[HelloController2]
router.add[WazzupController2]
}
}
class HelloController2 extends Controller {
get("/hello") {request: Request => "FitmanApp Hello world !"}
}
class WazzupController2 extends Controller {
get("/wazzup") {request: Request => "wazzup bro !!!!! @@"}
}