pekko/akka-docs/rst/java/http/routing-dsl/directives/path-directives/pathEndOrSingleSlash.rst
Fabian Gutierrez ee77273fac akka http javadsl - add path directive tests (#20813)
* akka http javadsl - add debugging directive test

* fixes line breaks

* add additional examples on PathDirectives

* link documentation to test examples

* include example on redirectToNoTrailingSlashIfPresent and redirectToTrailingSlashIfMissing

* include example on redirectToNoTrailingSlashIfPresent and redirectToTrailingSlashIfMissing
2016-06-22 01:13:27 +02:00

19 lines
674 B
ReStructuredText

.. _-pathEndOrSingleSlash-java-:
pathEndOrSingleSlash
====================
Description
-----------
Only passes the request to its inner route if the unmatched path of the ``RequestContext`` is either empty
or contains only one single slash.
This directive is a simple alias for ``rawPathPrefix(Slash.? ~ PathEnd)`` and is mostly used on an inner-level to
discriminate "path already fully matched" from other alternatives (see the example below).
It is equivalent to ``pathEnd | pathSingleSlash`` but slightly more efficient.
Example
-------
.. includecode:: ../../../../code/docs/http/javadsl/server/directives/PathDirectivesExamplesTest.java#path-end-or-single-slash