chore: debug log 仅输出app的log fix(commons): fix sanitize not return value. feat(webhooks): add gitea webhooks api. Co-authored-by: Ivan Li <ivanli@live.cn> Co-authored-by: Ivan <ivanli@live.cn> Reviewed-on: #2 Co-Authored-By: Ivan Li <ivan@noreply.%(DOMAIN)s> Co-Committed-By: Ivan Li <ivan@noreply.%(DOMAIN)s>
14 lines
422 B
TypeScript
14 lines
422 B
TypeScript
import { Injectable, NestMiddleware } from '@nestjs/common';
|
|
import { json, urlencoded, text } from 'body-parser';
|
|
import { Request, Response, NextFunction } from 'express';
|
|
|
|
@Injectable()
|
|
export class ParseBodyMiddleware implements NestMiddleware {
|
|
use(req: Request, res: Response, next: NextFunction) {
|
|
json()(req, res, () =>
|
|
urlencoded()(req, res, () => text()(req, res, next)),
|
|
);
|
|
// next();
|
|
}
|
|
}
|