Skip to content

A talk I gave at the Seattle Web App Developers Group meetup on April 10th, 2019.

License

Notifications You must be signed in to change notification settings

TylerLeonhardt/AutoRest-PowerShell-Nodejs-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplify testing of REST APIs and auto-generating code using AutoRest

Auto-generate code!

Prereqs

  1. Get Node.js.
  2. Get PowerShell.
  3. Get AutoRest.

AutoRest demos

MtRainier

A simple web app and API that says whether Mt. Rainier is visible.

  • OpenAPI Spec: mtrainier.yml & mtrainier.json
  • Language: PowerShell
  • Generated Code Folder: MtRainier

Build steps for MtRainier

  1. cd MtRainier
  2. autorest --input-file=./mtrainier.yml --output-folder=./PSMtRainier --powershell
  3. cd PSMtRainier
  4. ./build-module.ps1 -Run - build and start a new instance of PowerShell with the module loaded.
  5. Get-MtRainier - Run the command.

FDIC

I got this from the official FDIC API docs page! The only modification was changing the server.url since I downloaded the files and merging the files into 1 file.

PowerShell

  • OpenAPI Spec: fdic.yaml
  • Language: PowerShell
  • Generated Code Folder: PSFdic
Build steps for PSFdic
  1. cd FDIC
  2. autorest --input-file=./fdic.yaml --output-folder=./PSFdic --powershell --v3
  3. cd PSFdic - to install dependencies.
  4. ./build-module.ps1 -Run - build and start a new instance of PowerShell with the module.
  5. Search-StructureInstitution -Filters 'STALP:WA' - Run a command.

Node.js

  • OpenAPI Spec: fdic.yml
  • Language: Node.js
  • Generated Code Folder: fdic.js
Build steps for fdic.js
  1. cd FDIC
  2. autorest --input-file=./fdic.yaml --output-folder=./fdic.js --nodejs --v3
  3. npm install - to install dependencies.
  4. npm run compile - to compile the TypeScript. (NOTE: you may get errors, that's ok)
  5. npm start - run the code.

Links and Links

About

A talk I gave at the Seattle Web App Developers Group meetup on April 10th, 2019.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published