init
This commit is contained in:
1 parent
2addb3730d
commit
e66daebd4d
1 file changed
+15
-2
+15
-2
@@ -1,12 +1,25 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, HttpStatus, Req, Res } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
constructor(private readonly appService: AppService) {
|
||||
}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
}
|
||||
|
||||
@Get('/testyoupaiyun')
|
||||
testYouPaiYun(@Req() req: Request, @Res() res: Response): void {
|
||||
console.log(req.params);
|
||||
console.log(req.query);
|
||||
console.log(req.path);
|
||||
req.res.status(HttpStatus.OK).json({
|
||||
code: 0,
|
||||
msg: 'success',
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user