spotter v0.5.1 Spotter.Router

Router struct that handles the endpoints and makes dispatching.

Link to this section Summary

Functions

Defines the router struct

Returns an endpoint that matches to the path argument. Otherwise returns nil

Creates a new router based on the list of tuples. Each tuples represent an endpoints, that required for pre-processing and validating

Link to this section Functions

Link to this function %Spotter.Router{} (struct)

Defines the router struct.

Link to this function dispatch(router, path)
dispatch(router :: Spotter.Router, path :: Strint.t()) :: dispatch_result()

Returns an endpoint that matches to the path argument. Otherwise returns nil.

Link to this function new(endpoints)
new(endpoints :: [default_endpoint_args() | custom_endpoint_args()]) ::
  Spotter.Router

Creates a new router based on the list of tuples. Each tuples represent an endpoints, that required for pre-processing and validating.