-
Notifications
You must be signed in to change notification settings - Fork 24
Quick Start: Deploy To Apigee Edge
- Why deploy to Apigee Edge?
- Prerequesites
- Basic steps
- Detailed description
- Test your app on Edge
- Examples
- If you are using OAuth
When Apigee-127 applications are deployed to the Apigee Edge platform, they will take advantage of local optimizations so that they run with the best possible availability, scalability, and performance.
To deploy your Apigee-127 project to Apigee Edge you'll need:
- An account on Apigee.com. If you do not have an Apigee.com account, you'll be prompted to create one when your run this command. You can take advantage of an Edge Free account. See the note below for details.
- An Apigee-127 account configured with your Apigee.com account information. For example:
$ a127 account create <my_account>
Note: An Edge Free account includes all of the features of Apigee Edge and can be used for up to 5 million API calls per quarter. While it does not include technical support, you are free to use the Apigee Edge Community forum to ask questions. For details about Edge Free and other pricing options, see Apigee Edge Pricing Features.
Important: If you are using OAuth in your API, see "If you are using OAuth" for steps you must follow before you generate an access token for your API.
If you do not have one, you must create an Apigee-127 account with your Apigee Edge account information. Enter this command and follow the prompts:
a127 account create <my-account>
From the root directory of your Apigee-127 project, run:
a127 project deploy
Apigee-127 bundles up your project and deploys it to Edge. It uses the Apigee account information stored in the currently active Apigee-127 account.
The $ a127 project deploy
command uses apigeetool
behind the scenes to deploy your Apigee-127 project to Apigee Edge.
The $ a127 project deploy
command includes these options:
-
-h or --help
Prints usage information to standard output
-
-a or --account [account]
Lets you specify which Apigee-127 account to use. By default, the command takes the currently active account. To see which account is active, do
a127 account list
. -
-i or --import-only
Imports the project to Edge, but does not deploy it.
-
-n or --name [name]
Overrides the default name for the project. The default name is
a127-<project_root_folder_name>
. For example,a127-example-project
. -
-main or --main [main]
Overrides the main Node.js application file. In a new Apigee-127 project, the main file is
<project-folder>/app.js
. -
-b or --base [path]
Overrides the base path for the Apigee Edge API proxy deployment. By default, the base path is
/<project-name>
. -
-d or --docs [path]
Overrides the base path from where your API's documentation is accessed. The default is
/docs
. -
-u or --upload
Uploads Node.js modules to Edge instead of resolving them on Edge. Without this option, it's like running
npm install
on Edge.
When deploying for production, we recommend that you either:
- use
npm shrinkwrap
or - use the -u option.
If you do neither, the actual version of npm packages that you get may differ from your local environment. If -u is not specified, Edge excutes an npm install
, using the package.json
file as its reference.
After your project is deployed, Edge will not subsequently update or change any of the modules, unless you redeploy. It's a good practice to lock down the package versions in package.json
before deploying your project to a production environment.
$ curl http://ORG-ENV.apigee.net/PROJECT-NAME
Substitute the name of your organization on Apigee Edge, the name of the environment to deploy to (e.g., test), and the name of the deployed project. By default, the name is a127-<project-name>
, where <project-name
is the name of your Apigee-127 project. You can specify a different name if you deploy with the -n option.
##Examples
$ a127 project deploy -n myproxy
Deploys the project to Apigee Edge as an API proxy named
myproxy
.
$ a127 project deploy -m myfile.js
Deploys the project to Apigee Edge and configures the main Node.js file to be
myfile.js
.
If you apply OAuth security to any of your API endpoints, you must follow the steps described here before you generate an access token. You need to add a "/" resource to the product associated with the developer app where you will obtain the keys to generate an access token.
- Log on to the Apigee Edge management UI.
- Select Publish > Developer Apps and open the developer app that contains the Consumer Key and Consumer Secret that you intend to use to generate an access token.
- Click the link to the product that's associated with the app.
- In the Product page, click Edit.
- In the Paths section under Resources, click + Custom Resource.
- Enter "/" as the custom resource (without quotes).
- Click Save.
- Now you can generate an access token.
Having Trouble? Try posting your question to the Apigee Community. Or, for more links and resources, check out our Help Page
Need help? Visit the Apigee Community ! |
---|
-
Getting started
-
Add policies to your API
-
Add security policies
-
Deploy your projects
-
Programmatic hooks
-
Good to know about
-
Deep dives
-
Reference topics
-
Troubleshooting and getting help
-
Related resources