Initial commit
This commit is contained in:
20
apps/backend/src/hello/hello.controller.ts
Normal file
20
apps/backend/src/hello/hello.controller.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
import { tsRestHandler, TsRestHandler } from '@ts-rest/nest';
|
||||
import { contracts } from '@my-monorepo/common';
|
||||
|
||||
@Controller()
|
||||
export class HelloController {
|
||||
@TsRestHandler(contracts)
|
||||
handler(): unknown {
|
||||
return tsRestHandler(contracts, {
|
||||
hello: () => {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
body: {
|
||||
payload: 'hello',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user