DEV Community

Discussion on: Creating your first Node.js REST API with Nest and Typescript

Collapse
 
colmben profile image
colmben

Great article, a really concise intro to Nest. A couple of small points:

  • In the controller @Get, you are returning an array (from Filter). When you Type this up against your interface that is going to look strange. I'd be more inclined to just use .find to return the first one found.

  • For Delete, deleting against the Body object feels weird. I know you are not explicitly creating a RESTful API but if I can GET from products/:id, I would expect to DELETE the same way. So I'd expect to see @Delete(':id') in the service and that id used to find the object to delete.