refactor: migrate backend to NestJS
All checks were successful
/ build (push) Successful in 1m5s

This commit is contained in:
fred 2026-02-11 09:36:55 -08:00
parent 7258d283ed
commit 31f5bdc254
42 changed files with 21523 additions and 1040 deletions

View file

@ -0,0 +1,45 @@
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
} from '@nestjs/common';
import { RecipesService } from './recipes.service';
import type { CreateRecipeDto } from './create-recipe.dto';
@Controller('recipe')
export class RecipesController {
constructor(private readonly recipeService: RecipesService) {}
@Post()
create(@Body() createRecipeDto: CreateRecipeDto) {
return this.recipeService.create(createRecipeDto);
}
@Get()
findAll() {
return this.recipeService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.recipeService.findOne(+id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateRecipeDto: CreateRecipeDto) {
return this.recipeService.update(+id, updateRecipeDto);
}
@Patch(':id/stars')
setStars(@Param('id') id: string, @Body('stars') stars: number) {
return this.recipeService.setStars(+id, stars);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.recipeService.remove(+id);
}
}