You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
319 B

import { Middleware, Request, http, HTTPStatus } from '../../../bundle/daton.ts'
export default class TestMiddleware extends Middleware {
public async handleRequest(request: Request) {
if ( Math.random() >= 0.5 ) {
return http(HTTPStatus.FORBIDDEN, 'Well, you were unlucky.')
}
}
}