ogmake

← All templates

Patch

A unified diff — full-width red and green rows are the card, no window chrome.

Patch template preview

Try it

POST /v1/images, Bearer-authenticated, with this template id and params — see the quickstart for how to get a key, and for a signed-URL example that links straight to a cacheable, cache-forever image URL without a server round trip.

curl https://ogmake.com/v1/images \
  -H "Authorization: Bearer og_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "template": "patch",
  "params": {
    "file": "src/index.ts",
    "removed": [
      "export const VERSION = \"0.4.2\";"
    ],
    "added": [
      "export const VERSION = \"0.5.0\";",
      "export const CACHE_TTL = 86400;"
    ],
    "hunk": "@@ -1,2 +1,3 @@"
  }
}'

This template requires an array field (added) — over a GET route (Public URLs, Signing) it's carried as bracket-indexed query keys instead of a JSON array; see the reference's "Array fields on GET routes". A working public-URL example (mint a real key in the dashboard to replace k_yourkeyid):

GET https://ogmake.com/p/k_yourkeyid/patch?file=src%2Findex.ts&removed%5B0%5D=export+const+VERSION+%3D+%220.4.2%22%3B&added%5B0%5D=export+const+VERSION+%3D+%220.5.0%22%3B&added%5B1%5D=export+const+CACHE_TTL+%3D+86400%3B&hunk=%40%40+-1%2C2+%2B1%2C3+%40%40

More templates.