Skip to content

Latest commit

 

History

History

README.md

JmpAPI Configuration

JmpAPI builds a JSON-over-HTTP API from one or more YAML files. Each file declares URL endpoints that map HTTP methods to SQL queries, login flows, file serving, websockets, HTTP proxies, external programs, and conditional pipelines.

A minimal config:

jmpapi: 1.2.0

info:
  title: Example
  version: 1.0.0

endpoints:
  /hello:
    get:
      sql: SELECT 'world' AS greeting
      return: dict

Run with jmpapi config.yaml.

Reference

Conventions

  • {name} in a URL is a path parameter, available as {args.name}.
  • {x.y} inside a string references a request value: bound as a parameter in SQL, interpolated elsewhere (see sql.md). A missing ref is an error; {~x.y} resolves null when missing.
  • Keys starting with / are nested child paths.
  • HTTP methods are lower-case (get, put, post, delete); combine with | (e.g. get|put); use any to match all methods.

Example configs

See api/jmpapi-example.yaml, api/jmpapi-auth.yaml, and api/jmpapi-files.yaml in this repo for working examples.