Skip to content

Upload API

Handles image uploads to S3 storage for menu items and other assets.

POST /t/:slug/upload

Uploads a file directly to S3.

Auth: Admin JWT required. Content-Type: multipart/form-dataField: file — image file (JPEG/PNG/WebP, max 5 MB)

Response:

json
{ "url": "https://s3.amazonaws.com/bucket/tenants/slug/abc123.jpg" }

POST /t/:slug/upload/url

Fetches an image from a public URL and re-uploads it to S3.

Auth: Admin JWT required. Content-Type: application/json

Body:

json
{ "url": "https://external-site.com/image.jpg" }

Response:

json
{ "url": "https://s3.amazonaws.com/bucket/tenants/slug/abc123.jpg" }

Environment Variables

VariableDescription
AWS_ACCESS_KEY_IDS3 credentials
AWS_SECRET_ACCESS_KEYS3 credentials
AWS_REGIONAWS region (e.g. us-east-1)
AWS_S3_BUCKETTarget S3 bucket name

Frontend Component

frontend-react/src/components/ui/ImageUpload.tsx — dual-tab (file/URL) upload with drag-drop and preview. Used in menu item forms.

Lançado sob a licença MIT.