Before deploying your API proxy to production, you need to make sure that it is thoroughly reviewed and tested. Static code analysis is an important procedure you can run that helps to ensure your code is consistent and clean. This process is known as _linting_, and Apigee API proxies can take advantage of an open-source tool called apigeelint. In this hands-on lab, we’ll take the preliminary steps necessary to run apigeelint, exporting our API proxy using the Apigee Edge Management APIs. Then, we’ll install apigeelint and use it to validate our code, displaying the results in a table format.
Successfully complete this lab by achieving the following learning objectives:
- Export the API Proxy
- On the Apigee dashboard page, click API Proxies.
- Click the link for the proxy you want to analyze.
- Review the name and revision number.
- In your browser, navigate to https://apidocs.apigee.com/management/apis.
- In the Apigee Management APIs navigation menu, select API Proxies > Export API Proxy.
- Scroll down the page to the Resource URL section.
- Complete the Resource URL by filling in the following elements:
- Your organization name
- Your API proxy name
- Your proxy’s revision number
- In the HTTP Basic box, click Set…
- In the Set Authentication dialog, enter your Apigee email and password.
- Click Save.
- Click Send this request.
- Select the cURL tab.
- Copy the generated cURL command to your clipboard.
- In your terminal, paste the copied cURL command, and add the following:
- Install and Run apigeelint
- Change to your
- Verify that the
LAproxy.zipfile is in the Downloads directory.
- Install apigeelint.
sudo npm install -g apigeelint
- Enter your password at the prompt.
- Unzip the downloaded proxy.
- Run apigeelint on the proxy folder.
apigeelint -s apiproxy/ -f table.js
- Review the results.
- Change to your