Quick start - apigee-127/a127-documentation GitHub Wiki
The purpose of this Quick Start is to show you how easily and quickly you can get a simple API up and running using Apigee-127.
Get an API up and running
First, we create a new Apigee-127 project and test the default "hello world" API.
- Follow the steps here: Installation
- Create a root folder for your Apigee-127 projects and cd to that folder.
- Execute:
a127 project create hello-world. This will clone a project skeleton from GitHub into a directory from the working directory namedhello-world. It will then runnpm installto download dependencies for the project. Windows Users please see the note below regarding npm - Change to the
hello-worlddirectory by typing$ cd hello-world - Type
$ a127 project startto start your API. You now have an API running with Apigee-127! - If you see a message like "Do you want the application “node” to accept incoming network connections?", allow it.
- In another terminal, run:
$ curl http://localhost:10010/hello?name=Me. You should see the responseHello, Me.
That's it - You have now created, started and tested your first API project with Apigee-127!
Open the Swagger editor
Before moving on to another topic, start the Swagger editor. It loads in the Swagger specification file for the quick start API and lets you design and test your API interactively.
From the root folder of the Apigee-127 project, execute:
a127 project edit
The Swagger editor for Apigee-127
You'll start working with the editor in the next Quick Start topic: Add a Quota.
Next steps
Next, we'll show how to build out the API with important features like caching, quota management, OAuth 2.0, and more.
- [Add a Quota] quickstart-add-qouta
- [Add a Path] quickstart-add-path
- [Implement a Controller] quickstart-implement-controller
- [Add Caching] quickstart-add-caching
- [Add Apigee OAuth] quickstart-add-oauth-apigee
- [Add Apigee Analytics] quickstart-add-analytics-apigee
- [Deploy to Apigee Edge] quickstart-deploy-edge
Windows Users
For some versions of npm on Windows will have problems on the npm install step of a127 project create. They are related to a debug module on npm not being managed properly. The following steps should resolve this issue:
- In the project directory, execute the following commands:
npm install yamljsnpm install debugnpm install swagger-tools
Now, when you run a127 project start your project should start successfully.