On behalf of the student, upload the web app they created to the agent-sandbox-app-hosting server.
Procedure
1. Collecting the files to upload
Ask the student to specify the app directory, and check the files with Glob and Read.
Validation (always check before uploading):
index.htmlthat exists (required)- The total file size must be 50MB or less
- The title must be 1 to 100 characters
2. Assembling and running the curl command
Based on the collected files, curl Assemble and run the command.
MIME type mapping table:
| Extension | type |
|---|---|
.html |
text/html |
.css |
text/css |
.js |
application/javascript |
.json |
application/json |
.png |
image/png |
.jpg / .jpeg |
image/jpeg |
.gif |
image/gif |
.svg |
image/svg+xml |
.ico |
image/x-icon |
.mp3 |
audio/mpeg |
.wav |
audio/wav |
.mp4 |
video/mp4 |
.woff2 |
font/woff2 |
| Other | application/octet-stream |
curl command format:
curl -X POST "https://agent-sandbox-app-hosting.up.railway.app/api/apps" \
-F "title=<タイトル>" \
-F "description=<説明(任意)>" \
-F "files=@<ファイルパス>;type=<MIMEタイプ>" \
-F "files=@<ファイルパス>;type=<MIMEタイプ>;filename=<アプリ内パス>"
File specification rules:
- Files directly under the root (e.g.:
index.html):filename=no need to specify - Files in subdirectories (e.g.:
css/style.css):filename=css/style.cssspecify a relative path such as
3. Reporting the result
When the upload succeeds, the following JSON is returned.
{
"id": "...",
"url": "https://<サーバー>/apps/..."
}
To the student, url Tell them the value of and instruct them to open it in a browser to check that it works.
Handling errors
| Error message | Cause | Remedy |
|---|---|---|
index.html is required |
index.html is not included | Check the file name, and if it does not exist, ask the student to create it |
title must be between 1 and 100 characters |
The title is unspecified or too long | Confirm the title with the student |
Total file size exceeds 50MB limit |
The file is too large | Suggest compressing images or excluding unnecessary files |