![]() ![]() You can see that it has the name of our application, the version number, and then, it defines all of the paths that exist in the API. Let's start looking on the right-hand side first. ![]() When I run that command, it opens up a browser for me, points it to localhost, and to a port that it's created to host this Swagger interface. We can get to that using the Swagger project edit command. The really cool part about using Swagger is that it has this editor that allows us to define our API. It gives us an example that we can use here to start it, we'll just try that over here in our other pane. I can go into that directory, and then start my project using the Swagger project, start, and the name of my project. There's a new directory called "todo-api." Switching over to my other pane, I can do a directory listing. I'm going to use the Express framework, and that's going to kick off the installation from the skeleton project. It supports multiple frameworks, including Express, Hapi, Restify, and Sales. With that installed, I can create a new Swagger project using the Swagger command with Swagger project create, and then the name for my project, which is going to be todo-api. It has a command line interface, I'm going to install it using the -g flag to install it globally. ![]() To get started using Swagger, the first thing I need to do is install the package itself. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |