@rsrdev/specs-html
v0.0.2
Published
Upload an HTML spec/plan file and get back a shareable URL
Readme
📮 @byrafael/specs-html
A tiny PHP application to host AI-generated specs and plans: curl POST
an HTML file, get back a shareable URL, open it in a browser. One PHP file, no
database, and no dependencies.
You're right. PHP isn't the trendy new framework. This is intentional: the goal is a single-file tool that runs on inexpensive/shared hosts without extra runtime or build steps. It works everywhere PHP does (which is most of the internet).
Quickstart
- Copy
main.phpto any PHP host (shared hosting, a VPS, etc.). - Edit
main.phpand setUPLOAD_TOKENto a long random secret.
Generate a token with:
openssl rand -hex 24Upload a plan:
curl -X POST --data-binary @plan.html \
-H "Authorization: Bearer YOUR_TOKEN" \
https://example.com/main.phpThe response is the public URL on its own line, e.g.:
https://example.com/main.php/brave-otterOptions
- Multipart upload: use
-F [email protected]instead of--data-binary. - Choose a name: add
?name=my-planto the upload URL. - JSON response: add
?jsonto the upload request.
Tips & notes
- Max upload size is 5 MB (
MAX_BYTES) — also limited by your php.ini. - Plan names are restricted to
[a-z0-9-]and files are confined toplans/. - Uploaded plans are served as
text/html, so any JS/CSS in them runs. - Verify the PHP syntax locally with
php -l main.phpbefore deploying.
That's it — small, simple, and portable. MIT Licensed. Feel free to contribute, fork, or whatever.
