Quick Start Guide
Get Keystone Gateway running in 5 minutes.
Installation
git clone https://github.com/ygalsk/keystone-gateway.git
cd keystone-gateway
make build
Minimal Configuration
Create config.yaml:
lua_routing:
enabled: true
scripts_dir: "./examples/scripts"
global_scripts:
- "init"
- "handlers"
tenants:
- name: "api"
path_prefix: "/api"
routes:
- method: "GET"
pattern: "/hello"
handler: "hello_handler"
Create Your First Handler
Create examples/scripts/handlers.lua:
function hello_handler(req)
return {
status = 200,
body = "Hello from Keystone!",
headers = {["Content-Type"] = "text/plain"}
}
end
Run the Gateway
./keystone-gateway -config config.yaml
Test it:
curl http://localhost:8080/api/hello
# Output: Hello from Keystone!
What Just Happened?
- Configuration loaded: Gateway read
config.yaml - Lua scripts executed:
init.luaandhandlers.lualoaded into state pool - Routes registered:
/api/hello→hello_handlerfunction - Request processed:
- HTTP GET → Chi router → Lua handler
- Handler returned response table
- Gateway wrote HTTP response
Next Steps
- Configuration Guide - Full YAML reference
- Lua API Reference - Handler and middleware interfaces
- Examples - Working code samples