added TryIt buttom for HTML help,
added Bearer token for testing API
This commit is contained in:
@ -7,6 +7,9 @@ The project also generates frontend clients:
|
||||
- JavaScript client: `format=javascript` (`.js`)
|
||||
- TypeScript client: `format=typescript` (`.ts`, real typed output)
|
||||
|
||||
The HTML help page is also interactive:
|
||||
- HTML help: `format=html` includes endpoint docs, a built-in request tester, and optional Bearer token support stored in browser `localStorage`
|
||||
|
||||
## Core files
|
||||
- `src/APIlite.php`: runtime, routing, docs JSON/HTML/client generation
|
||||
- `src/help.tpl.php`: HTML documentation template
|
||||
@ -19,7 +22,9 @@ The project also generates frontend clients:
|
||||
- Maintain both generated clients:
|
||||
- JavaScript stays plain JS.
|
||||
- TypeScript stays typed (interfaces + typed method signatures).
|
||||
- Keep the HTML help page usable both as documentation and as a lightweight in-browser tester.
|
||||
- If you change output field names in JSON help, update README and templates consistently.
|
||||
- If you change request metadata or tester behavior, update `README.md` and keep `src/help.tpl.php` aligned with the actual runtime request model.
|
||||
- Prefer small, focused changes over broad rewrites.
|
||||
|
||||
## Verification checklist
|
||||
@ -29,6 +34,8 @@ The project also generates frontend clients:
|
||||
- `php -l src/javascript.tpl.php`
|
||||
- `php -l src/typescript.tpl.php`
|
||||
- `php -l bin/apilite-files`
|
||||
- If HTML help changes, also render it once:
|
||||
- `php test/APIcalculator.php --html`
|
||||
- If client generation changes, test with:
|
||||
- `php test/APIcalculator.php --javascript`
|
||||
- `php test/APIcalculator.php --typescript`
|
||||
|
||||
Reference in New Issue
Block a user