LazyStack

Test Local WebApi

In this step we will use a browser page to make calls against the local WebApi (PetStoreMac) project.

5.1 Test WebApi using Browser

  1. Set the startup project to PetStoreMac.
  2. Start Debugging the PetStoreMac project. A browser tab opens showing the Swagger PetStoreAPI.
    • You may see a Security Warning dialog "Invalid development certificate found". Select "Run" if this dialog appears. You will then be prompted for your password. Provide the password and click the "Always Allow" button.
  3. Execute the "/pet/seedPets" call. (Note: You need to click on "Try it Out".) Two pets are added to the DynamoDB table.
  4. Execute /pet/findByStatus with petStatus = 0. Two pet records are returned in the Response body.
  5. Stop Debugging.
Step Summary

In this step we launched the local WebApi (PetStoreMac) project and then made calls against it using the local server's Swagger page. Our call to "/pet/seedPets" executed the PetStoreRepo project's PetRepo.SeedPetsAsync() method. The local WebApi (PetStoreMac) project used your local AWS credentials to access the PetStoreDev stack DynamoDB resource.

In addition to making calls using the browser, later lesson steps will demonstrate making calls against the WebApi (PetStoreMac) project from client apps. This allows you to debug both the client code and controller code at the same time.