Endpoint

trait Endpoint[OuterReturned, InnerReturned, Input] extends Decorator[OuterReturned, InnerReturned, Input]

An HttpEndpoint that may return something else than a HTTP response, e.g. a websocket endpoint which may instead return a websocket event handler

trait Decorator[OuterReturned, InnerReturned, Input]
class Annotation
class Object
trait Matchable
class Any
class websocket
trait HttpEndpoint[InnerReturned, Input]
class delete
class get
class options
class patch
class post
class put
class route
class getJson
class postForm
class postJson

Type members

Inherited types

final type Delegate = Map[String, Input] => Result[InnerReturned]
Inherited from:
Decorator
type InputParser[T] <: ArgReader[Input, T, Request]
Inherited from:
Decorator
final type InputTypeAlias = Input
Inherited from:
Decorator

Value members

Abstract methods

def wrapPathSegment(s: String): Input

HttpEndpoints are unique among decorators in that they alone can bind path segments to parameters, e.g. binding /hello/:world to (world: Int). In order to do so, we need to box up the path segment strings into an Input so they can later be parsed by getParamParser into an instance of the appropriate type.

HttpEndpoints are unique among decorators in that they alone can bind path segments to parameters, e.g. binding /hello/:world to (world: Int). In order to do so, we need to box up the path segment strings into an Input so they can later be parsed by getParamParser into an instance of the appropriate type.

Concrete methods

def convertToResultType[T](t: T)(implicit f: Conversion[T, InnerReturned]): InnerReturned
def subpath: Boolean

Whether or not this endpoint allows matching on sub-paths: does @endpoint("/foo") capture the path "/foo/bar/baz"? Useful to e.g. have an endpoint match URLs with paths in a filesystem (real or virtual) to serve files

Whether or not this endpoint allows matching on sub-paths: does @endpoint("/foo") capture the path "/foo/bar/baz"? Useful to e.g. have an endpoint match URLs with paths in a filesystem (real or virtual) to serve files

Inherited methods

def getParamParser[T](implicit p: InputParser[T]): InputParser[T]
Inherited from:
Decorator
def wrapFunction(ctx: Request, delegate: Delegate): Result[OuterReturned]
Inherited from:
Decorator

Abstract fields

val methods: Seq[String]

Which HTTP methods does this endpoint support? POST? GET? PUT? Or some combination of those?

Which HTTP methods does this endpoint support? POST? GET? PUT? Or some combination of those?

val path: String

What is the path that this particular endpoint matches?

What is the path that this particular endpoint matches?