apigee-templater
v4.1.2
Published
Provides tooling for feature development of Apigee proxies using YAML, JSON and ZIP formats, and REST, MCP & CLI interfaces.
Readme
Apigee Feature Templater (aft) 🚀
Apigee Feature Templater is your new best friend for API authoring. Forget repetitive boilerplate—Feature 🧩 and Template 🏗️ definitions let you compose APIs like a pro. Deploy them as Apigee proxies 📦 and go grab a coffee ☕.
Get the Party Started 🎉
npm i apigee-templater -gConcepts & Formats 🧠
1. Feature 🧩
Think of this as a Lego brick for your API logic. Policies, resources, parameters—all wrapped up nicely.
Example my-feature.yaml:
name: response-hello-world
type: feature
description: Adds a hello world message to the response.
parameters:
- name: MESSAGE
default: Hello world!
policies:
- name: JS-AddMessage
type: Javascript
content:
javascript:
resourceUrl: jsc://add-message.js
resources:
- name: add-message.js
type: jsc
content: |
context.setVariable("response.content", "Hello world!");2. Template 🏗️
The blueprint. Mix and match features to build your dream API.
Example my-template.yaml:
name: AI-Gateway-v1
type: template
description: API template for AI-Gateway-v1
features:
- target-llm-gemini
- auth-key-header
parameters:
- name: auth-key-header.API_KEY_HEADER_NAME
default: x-api-key
endpoints:
- name: default
basePath: /v1/gemini
routes:
- name: default
target: llm-gemini
targets:
- name: llm-gemini
url: https://aiplatform.googleapis.com/v1/projects/{organization.name}/locations/global/endpoints/openapi/chat/completions
auth: GoogleAccessToken3. Proxy 📦
The final package. Ready to ship to Apigee. It is also the format used internally when a Template is processed.
Example my-proxy.yaml:
name: SimpleProxy-v1
type: proxy
description: A simple proxy definition.
endpoints:
- name: default
basePath: /v1/simple
routes:
- name: default
target: default
targets:
- name: default
url: https://mocktarget.apigee.netMagic Spells (Commands) 🧙♂️
Conjure a new template: 🪄
aft my-template.yamlEnchant a template with a feature: ✨
aft my-template.yaml -a target-httpbinLaunch (Deploy) to Apigee: 🚀
PROJECT_ID=my-gcp-project aft -i my-template.yaml -o $PROJECT_ID:my-proxy-name
License 📜
Apache 2.0 - Not an official Google product (but still awesome).
