Now that the first API endpoint has been implemented, the next step is to test it.
First, provide some information to describe your API globally.
Then generate a new controller. This one will be in charge of rendering the new page.
Make the generated class extend the abstract class
SwaggerController. And then provide the root controller of your API as an option to the controller.
Finally, update your
app.controller.ts file so that the Swagger UI page is available at /swagger.
If you navigate to http://localhost:3001/swagger, you will see the documentation page generated from your code.
Now click on the Try it out button. The fields become editable and you can send requests to test your API.