akveo / ngx-admin-bundle-support

Support repository for ngx-admin backend bundles with issues tracking, instructions and code samples
58 stars 32 forks source link

how to run API Documentation using swagger #18

Closed mhhonline closed 4 years ago

mhhonline commented 4 years ago

Greeting,

it is not clear ho to run the swagger on the documentation. how to run api, what tool? need more clarification.

You can check API documentation by running api and accessing /swagger/ui/index#/ link. To use swagger with token authentication please follow these steps: open swagger link /swagger/ui/index#/ while running api expand Auth controller and open POST /api/auth/login action put correct user info into loginDto field (there is sample in swagger) and click 'try out' when received response with token, copy token (ctrl+c) there is input 'api_key' at top right corner. Paste there token in format: 'Bearer ' and click 'Explore' after UI was refreshed, you can try any requests, token will be added there

Thanks

valentinkononov commented 4 years ago

Hi! This instruction is working for Nest, .NET and .NET Core bundles. I have fixed Node instruction to make it consistent. Swagger was not added to Node because of necessity to configure it manually. Probably, we can introduce this feature later. Sorry for the confusion.

For Nest, .NET or .NET Core bundles please just open the url in browser. URL looks like <api_url/swagger>

for example, it can be localhost:3001/swagger.