Deno Deploy
by @hosainnet
Deploy simple web pages and HTML apps live to the internet using the Deno Deploy REST API. Use this skill whenever the user wants to make something "live", "...
clawhub install deno-subhosting-deploy-skillπ About This Skill
name: deno-deploy description: Deploy simple web pages and HTML apps live to the internet using the Deno Deploy REST API. Use this skill whenever the user wants to make something "live", "hosted", "shareable via URL", "deployed", or "accessible online" β even if they don't mention Deno explicitly. Also trigger when the user asks to build a web page, interactive app, or HTML project that would benefit from a live URL. Does not require the Deno MCP tool β this skill is fully standalone and uses the Deno API directly. license: Apache-2.0 metadata: author: hosainnet version: "0.0.1"
Deno Deploy Skill (Standalone)
Deploy simple web pages and HTML apps to Deno Deploy using a bundled Python script that calls the Deno REST API directly. No MCP tool required.
Credentials Setup (First Time)
Before deploying, the user must create a Deno Subhosting organization and retrieve their credentials:
1. Go to dash.deno.com/subhosting/new_auto and create a new subhosting org 2. From the org dashboard, copy the org ID and access token
Then save them as config files under ~/.config/deno-deploy/:
mkdir -p ~/.config/deno-deploy
echo "your_token_here" > ~/.config/deno-deploy/access_token
echo "your_org_id_here" > ~/.config/deno-deploy/org_id
If these files don't exist, the deploy script will print a clear error with setup instructions. Direct the user to dash.deno.com/subhosting/new_auto to get started.
Step 1: Plan the App
Before writing code, think about:
For simple pages: serve everything from a single main.ts file with inline HTML.
Step 2: Write Good Deno-Compatible Code
Standard Pattern
All Deno Deploy apps must export a fetch handler:
export default {
async fetch(req: Request): Promise {
const html =
My App
; return new Response(html, {
headers: { "Content-Type": "text/html; charset=utf-8" },
});
},
};
Key Rules
require(), no fs, no pathhttps://cdn.tailwindcss.com)main.tscharset=utf-8 for HTML responsesnew URL(req.url).pathname for multi-route appsUseful CDN Libraries
| Purpose | URL |
|---|---|
| Tailwind CSS | https://cdn.tailwindcss.com |
| Alpine.js | https://cdn.jsdelivr.net/npm/alpinejs@3/dist/cdn.min.js |
| Chart.js | https://cdn.jsdelivr.net/npm/chart.js |
| Marked (markdown) | https://cdn.jsdelivr.net/npm/marked/marked.min.js |
Step 3: Save the Code to a File
Write the TypeScript code to a temporary file, e.g. /tmp/main.ts:
cat > /tmp/main.ts << 'EOF'
export default {
async fetch(req: Request): Promise {
...
},
};
EOF
Step 4: Deploy Using the Script
Run the bundled deploy script:
python scripts/deploy.py \
--name \
--code /tmp/main.ts
Project naming tips:
birthday-card, sales-dashboard, quiz-gameapp or testThe script will: 1. Create a new Deno Deploy project 2. Upload the code 3. Print the live URL
Step 5: Verify the Deployment
After the deploy script runs, you MUST verify the deployment was successful:
1. Check the script output β look at the deployment response JSON printed by the script:
- "status" should NOT be "failed". If it is, the code has errors β fix and redeploy.
- If the status is "pending", wait a few seconds and proceed to the next check.
2. Curl the live URL to confirm it's serving correctly:
curl -s -o /dev/null -w "%{http_code}" https://.deno.dev
- 200 = success, the page is live
- 404 or 500 = something is wrong β check the deployment logs URL printed by the script
- Any other error = the deployment may still be propagating, wait 5 seconds and retry once3. If the deployment failed, check for these common causes:
- Syntax errors in the TypeScript code (missing braces, unclosed template literals)
- Missing export default { fetch } handler
- Use of Node.js APIs (require, fs, etc.)
- Fix the issue in the code file and redeploy
Do NOT tell the user the deployment succeeded until you have confirmed it with curl.
Step 6: Share the Result
After a verified successful deployment, always:
1. Share the live URL prominently as a clickable link 2. Briefly explain what the user will see when they open it
Example: > Your page is live at https://your-project.deno.dev > > It shows [brief description]. Let me know if you'd like to change anything!
Common Pitfalls
β browsers may render in quirks mode without itexport default { fetch } β the app won't start without it