Currently as soon as route for defined all the requests are going through kakapo and do not appear in network panel of a dev tools, which is not ideal. Sometimes dev would like to know what requests are happening and what responses were issued.
Current workaround for me is to make subclass of a router and do logging manually:
class RouterWithLogging<M extends DatabaseSchema> extends Router<M> {
constructor(options?: RouterOptions){
super(options);
}
register(method: string, path: string, originalHandler: RequestHandler<M>) {
const handler: RequestHandler<M> = (
request: Request,
database: Database<M>
) => {
const response = originalHandler(request, database);
console.log({method, path, request, database, response});
return response;
};
return super.register(method, path, handler);
}
}