create-hest-app
Version:
Create HestJS-powered applications with one command
29 lines (25 loc) • 691 B
text/typescript
import { Controller, Get } from '@hestjs/core';
import { AppService } from './app.service';
('/')
export class AppController {
constructor(private readonly appService: AppService) {}
('/')
getHello() {
return {
message: this.appService.getHello(),
description: 'HestJS CQRS Demo - A demonstration of CQRS pattern using HestJS framework',
endpoints: {
users: {
getAll: 'GET /users',
getById: 'GET /users/:id',
create: 'POST /users',
update: 'PUT /users/:id',
},
},
};
}
('/error')
throwError() {
throw new Error('This is a test error for exception handling');
}
}