Versionary.Plug.EnsureVersion (Versionary v0.4.1) View Source

This plug ensures that a valid version was provided and has been verified on the request.

If the version provided is not valid then the request will be halted and the module provided to handler will be called. From there the handler can decide how to finish the request.

If a handler isn't provided Versionary.Plug.ErrorHandler.call/1 will be used as a default.

Example

plug Versionary.Plug.EnsureVersion, handler: SomeModule