Path

data class Path(pattern: String)

A path definition. It parses path patterns and extract values for parameters.

Differences with Sinatra:

  • No splats (you can use named parameters though)

  • Delimiter is {var} to conform with RFC 6570

Constructors

Link copied to clipboard
fun Path(pattern: String)

Functions

Link copied to clipboard
fun extractParameters(requestUrl: String): Map<String, String>
Link copied to clipboard
fun matches(requestUrl: String): Boolean

Properties

Link copied to clipboard
val hasParameters: Boolean
Link copied to clipboard
val hasWildcards: Boolean
Link copied to clipboard
val parameterIndex: List<String>
Link copied to clipboard
val pattern: String
Link copied to clipboard
val regex: Regex?
Link copied to clipboard
val segments: List<String>