Skip to content

A browser-based editor and emulator for AWS API Gateway VTL templates — with live preview, debug tools, and full in-browser execution.

Notifications You must be signed in to change notification settings

fearlessfara/apigw-vtl-emulator

Repository files navigation

VTL Emulator Pro

VTL Emulator Pro is a browser-based editor and emulator for Apache Velocity Template Language (VTL), designed to simulate AWS API Gateway integration request/response templates.


🔍 What is this?

This tool lets you:

  • Write and preview VTL templates live
  • Simulate $input, $util, and $context variables
  • Render and debug request/response flows
  • Manage variables for headers, query params, stage variables, and paths
  • Quickly test conditional blocks, loops, and transformations

🌐 Try it online

👉 https://fearlessfara.github.io/apigw-vtl-emulator

⚠️ No data is ever sent to any backend. Everything runs 100% in your browser. Perfect for privacy-sensitive workflows.


📁 Repository Structure

This repository contains:

Path Description
/index.html The browser UI HTML entry point
/script.js All the logic powering the editor UI
/emulator/ The standalone VTL engine used by the UI and NPM
/emulator/tests/ Unit tests for the engine
/img.png Screenshot used in documentation
/CONTRIBUTING.md Contribution guide for engine and UI development

You can contribute to either the visual interface or the evaluation engine.


🧰 Features

  • 🖊️ Monaco-based editor with syntax highlighting and autocompletion
  • 📦 Snippets for common AWS API Gateway use-cases
  • 📄 Compare VTL templates side-by-side
  • 📥 Import/export template configurations
  • 🎨 Light/Dark theme toggle
  • 📋 Output preview with copy/share/download support
  • 🔍 Debug panel showing render steps

📘 Screenshot

img.png


⚙️ VTL Engine (Published on NPM)

The engine simulates AWS API Gateway’s $input, $util, and $context using velocityjs, and is available as a package:


🚀 Quick Start (for the UI)

git clone https://github.com/fearlessfara/apigw-vtl-emulator.git
cd apigw-vtl-emulator
open index.html  # or use `npx live-server` / `python3 -m http.server`

📦 Quick Usage (VTL Engine via NPM)

npm install apigw-vtl-emulator
import {renderVTL} from 'apigw-vtl-emulator';

const output = renderVTL('$input.json("$.name")', {
  body: JSON.stringify({name: "Velocity"})
});
console.log(output); // "Velocity"

🤝 Contributing

See CONTRIBUTING.md for full guidelines on contributing to either the UI or engine.


📝 License

MIT — © 2025 Christian Gennaro Faraone

About

A browser-based editor and emulator for AWS API Gateway VTL templates — with live preview, debug tools, and full in-browser execution.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •