Octane: you could use a middleware framework or simple function wrapper