Build Your Own Cloud IDE with the Subhosting API
A cloud IDE can be built on the Deno Subhosting API, which programmatically deploys user code to Deno Deploy's global V8 isolate cloud within seconds. The walkthrough builds a Hono server with routes to list and create projects and deployments, plus a small TypeScript client that wraps the Subhosting REST endpoints with bearer-token auth. It also covers a server-rendered JSX page and an Ace Editor frontend that polls deployment status every five seconds. The deployment payload is explained in detail: entryPointUrl must map to a key in an assets map of files, and envVars inject credentials into the deployed code.
Related posts
- Manage your Deno Deploy and Deno Subhosting projects with Terraform
Deno mediumAdeptDeno now ships an official Terraform provider (denoland/deno) for managing Deno Deploy and Deno Subhosting projects, custom domains and deployments as infrastructure-as-code. A walkthrough deploys a local TypeScript server with a static asset: configure the provider with an organization ID and token (or DENO_DEPLOY_ORGANIZATION_ID/DENO_DEPLOY_TOKEN env vars), create a deno_project, collect files via the deno_assets data source with a root path and glob pattern, then define a deno_deployment with an entry point and env vars. Running terraform plan and apply creates the resources, and terraform state show reveals the deployment's deno.dev URL. The provider is pitched as simpler than calling the Subhosting API directly when coordinating hundreds of projects.
- Build and Ship Astro Sites with Deno and Deno Deploy
Deno mediumAdeptAstro sites can be built with the Deno runtime and hosted on Deno Deploy in two modes. Static output from `npm run build` is served via the Deno standard library file server and auto-deployed from GitHub Actions. Server-rendered apps use Astro's `output: "server"` mode with a Deno adapter, a generated `server/entry.mjs` entrypoint, and npm scripts rewritten to run Astro through `deno run -A --unstable npm:astro`. A template app shows SSR form handling in component scripts, client-side delete calls to an API route, and data persistence that can be switched to Deno KV.
- How to add Monaco to a Next.js app and securely run untrusted user code
Deno mediumAdeptA Next.js 14 app can host a browser IDE by embedding the Monaco editor via @monaco-editor/react, then sending the editor contents to server-side API routes that call the Deno Deploy Subhosting API. One route creates a uniquely named project, one creates a deployment from the submitted code, and one fetches deployment status. The client polls that status until it leaves 'pending' and, on success, loads the deployment URL in an iframe. Isolation of the untrusted code is handed off to Subhosting rather than implemented in the app. Suggested next steps include persisting projects, adding a filesystem and adding authentication.
- Static Files on Deno Deploy
Deno mediumAdeptDeno Deploy now stores static files alongside deployed code and distributes them to edge locations, where edge code reads them via Deno file system APIs (readFile, readDir, open, stat, etc.) or fetch. Because user code still controls responses, static assets can be auth-gated, given CORS headers, rewritten dynamically or streamed, and std's serveFile or oak handle Content-Type and Range requests. Files come from a linked GitHub repo automatically, or from build output uploaded with deployctl or a GitHub Action using OIDC without secrets. A Lume static site example deploys in about 25 seconds from push, 15 of which is runner startup; automatic mode deploys take 1-10s.
- Supabase Edge Runtime: Self-hosted Deno Functions
Supabase mediumAdeptSupabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes. A hyper HTTP server forwards requests to a Main Worker V8 isolate, which can create sandboxed User Worker isolates with restricted APIs and configurable memory (default 150 MB) and wall-clock (default 60s) limits. It also powers `supabase functions serve` for serving all functions locally with hot reload and Deno Deploy API parity, and a Fly.io walkthrough shows how to deploy it. Planned uses include replacing Kong as an API gateway, scheduled functions, and custom platform globals.