summaryrefslogtreecommitdiff
path: root/cask/test/src/test/cask/FormJsonPost.scala
blob: 2874a52e4c9a9a354c3ddf18c12276c30fb49b5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package test.cask

import cask.FormValue
import io.undertow.server.HttpServerExchange

object FormJsonPost extends cask.MainRoutes{
  @cask.postJson("/json")
  def jsonEndpoint(x: HttpServerExchange, value1: ujson.Js.Value, value2: Seq[Int]) = {
    "OK " + value1 + " " + value2
  }

  @cask.postForm("/form")
  def formEndpoint(x: HttpServerExchange, value1: FormValue, value2: Seq[Int]) = {
    "OK " + value1 + " " + value2
  }

  initialize()
}