Preview a template's script
POST
Returns exactly what an install would run on the server for these inputs: Layerbeat's short header (which passes your inputs as data and reports the result), then the template's install script, or your edited one.
Access: Public. No authentication required.
- Inputs given are checked against the template's input types; missing ones are left out of the preview.
scriptpreviews an edited install script (at most 24 KB).customizedsays whether it differs from the template's. While editing scripts is not available, an edited script returns403; the template's own script always previews.- Nothing is stored or run. The response is not cached.
id*stringTemplate ID, for example supabase.
application/json- body
inputs?script?stringAn edited install script to preview.
The script
application/json- response
template*stringversion*stringaction*"install"Value in
"install"customized*booleanbytes*integerscript*stringThe full script, as the server receives it.
curl -X POST 'https://layerbeat.com/v1/templates/https-proxy/script' \ -H 'Content-Type: application/json' \ -d '{ "inputs": { "domain": "app.example.com", "upstream": "127.0.0.1:3000" }}'{ "template": "https-proxy", "version": "1.0.0", "action": "install", "customized": false, "bytes": 3120, "script": "#!/bin/bash\n# Layerbeat template run (doc 052). Customer inputs are data: read them with lb_input.\nset -eEuo pipefail\n...\n# ---- https-proxy install.sh ----\ndomain=$(lb_input domain)\n..."}