object Routes extends RoutesCompanionVersionSpecific with Serializable
- Alphabetic
- By Inheritance
- Routes
- Serializable
- RoutesCompanionVersionSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[Env, Err](route: Route[Env, Err], routes: Route[Env, Err]*): Routes[Env, Err]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- val empty: Routes[Any, Nothing]
An HTTP application that does not handle any routes.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromIterable[Env, Err](routes: Iterable[Route[Env, Err]]): Routes[Env, Err]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def serveDirectory(path: Path, docRoot: File)(implicit trace: Trace): Routes[Any, Nothing]
Creates routes for serving static files from the directory
docRootat the url pathpath.Creates routes for serving static files from the directory
docRootat the url pathpath.Example:
Routes.serveDirectory(Path.empty / "assets", new File("/some/local/path"))With this routes in place, a request to
https://www.domain.com/assets/folder/file1.jpgwould serve the local file/some/local/path/folder/file1.jpg. - def serveResources(path: Path, resourcePrefix: String = "public")(implicit trace: Trace): Routes[Any, Nothing]
Creates routes for serving static files at URL path
pathfrom resources with the givenresourcePrefix.Creates routes for serving static files at URL path
pathfrom resources with the givenresourcePrefix.Example:
Routes.serveResources(Path.empty / "assets", "webapp")With this routes in place, a request to
https://www.domain.com/assets/folder/file1.jpgwould serve the filesrc/main/resources/webapp/folder/file1.jpg. Note how the URL path is removed and the resourcePrefix prepended.Most build systems support resources in the
src/main/resourcesdirectory. In the above example, the filesrc/main/resources/webapp/folder/file1.jpgwould be served.The
resourcePrefixdefaults to"public". To prevent insecure sharing of resource files,resourcePrefixmust start with a/followed by at least 1 valid java identifier character. The/will be prepended if it is not present. - def singleton[Env, Err](h: Handler[Env, Err, (Path, Request), Response])(implicit trace: Trace): Routes[Env, Err]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])