31 lines
954 B
Markdown
31 lines
954 B
Markdown
---
|
|
name: static-hosting
|
|
description: Serve static HTML/CSS/JS/images from robot project directories via the built-in FastAPI static file server. Use when generating web pages, reports, or interactive content for a bot.
|
|
category: Web Services
|
|
---
|
|
|
|
# Static Hosting
|
|
|
|
Host static files (HTML, CSS, JS, images, fonts, etc.) under the bot's project directory and get public URLs.
|
|
|
|
## Usage
|
|
|
|
Write files to `/app/projects/robot/{ASSISTANT_ID}/`, then run the script to get the public URL:
|
|
|
|
```bash
|
|
python3 {SKILL_DIR}/scripts/get_url.py <absolute_path>
|
|
```
|
|
|
|
Example:
|
|
|
|
```bash
|
|
python3 {SKILL_DIR}/scripts/get_url.py /app/projects/robot/{ASSISTANT_ID}/index.html
|
|
# => https://engine.aitravelmaster.com/robots/[bot-id]/index.html
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Inside HTML, use **relative paths** to reference other assets (e.g. `href="css/style.css"`)
|
|
- `index.html` is auto-served at the directory URL
|
|
- All files under `/robots/` are publicly accessible, no authentication
|