Titan icon indicating copy to clipboard operation
Titan copied to clipboard

Resurrect `TitanOnSteroids` and rethink what the usability story should be

Open swizzlr opened this issue 7 years ago • 0 comments

import Titan

let titanInstance = Titan.sensible() // 404 and healthchecks as standard
titanInstance.healthCheck = HealthzWithCheck {
 //...
}

let version3Routes = VersionedRoutes(version: 3, routes: [functToSetARoute, funcToSetSecondRoute])
let version2Routes = VersionedRoutes(version: 2, routes: [funcForV2OnlyRoute])
titanInstance.versionedRoutes = [version3Routes, version2Routes]
titanInstance.unversionedRoutes = [funcForYetAnotherRoute]

Setting versionedRoutes should allow errors to be thrown for matching but unversioned requests (as opposed to current 404 behavior.

swizzlr avatar Nov 16 '17 15:11 swizzlr