function *(next) middleware signature