Public
Upload sites quickly with Betlify
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🎯 Betlify

A lightweight hosting platform for uploading and instantly deploying HTML/CSS/JavaScript pages with assets. Just drag and drop a folder and get a live URL.

Features

Super Simple

  • Drag & drop your entire folder
  • Auto-detects HTML, CSS, and JavaScript
  • Uploads images, fonts, and assets automatically
  • Get a live URL instantly
  • No configuration required

🚀 Drag & Drop Interface

  • Beautiful, intuitive upload experience
  • Auto-detect page name from HTML filename
  • Click to browse or drag folder directly
  • Real-time asset preview

🔒 Secure & Fast

  • Pages stored in fast KV blob cache
  • Base64 encoding for all assets
  • Data URIs for asset delivery
  • Instant retrieval

Developer Friendly

  • Full REST API with cURL examples
  • JavaScript and Python integration examples
  • Comprehensive API documentation
  • Multipart form upload support

How It Works

  1. Go to Upload - https://val.town/x/brybod123/Betlify/ui
  2. Drag Your Folder - Just drop your project folder (or click to browse)
  3. Auto-Setup - Page name, HTML, CSS, JS, and assets are automatically detected
  4. Click Upload - Host your page instantly
  5. Share Link - Get a live URL like /pages/my-portfolio

API Endpoints

GET /ui

The beautiful drag-and-drop upload interface.

POST /api/upload

Upload a new page programmatically.

Request:

multipart/form-data:
- pageName (string): URL slug for your page
- html (file): Main HTML file (required)
- css (file, optional): Stylesheet
- js (file, optional): JavaScript
- assets (file[], optional): Images, fonts, etc.

Response:

{ "success": true, "url": "/pages/my-portfolio", "fullUrl": "https://brybod123--9c3ff1a062aa11f187aa1607ee4eb77e.web.val.run/pages/my-portfolio" }

GET /api/docs

View full API documentation with examples.

GET /pages/:pageName

Serve a hosted page with all CSS, JS, and assets injected.

Example: Drag & Drop

  1. Create a folder with your files:

    my-portfolio/
    ├── index.html
    ├── styles.css
    ├── script.js
    └── logo.png
    
  2. Drag the entire folder onto the upload area

  3. Confirm page name and click "⚡ Upload & Host"

  4. Share your page: https://...val.run/pages/my-portfolio

Example: API Upload

cURL

curl -X POST https://val.town/x/brybod123/Betlify/api/upload \ -F "pageName=my-portfolio" \ -F "html=@index.html" \ -F "css=@styles.css" \ -F "js=@script.js" \ -F "assets=@logo.png"

JavaScript

const formData = new FormData(); formData.append('pageName', 'my-portfolio'); formData.append('html', htmlFile); formData.append('css', cssFile); formData.append('assets', imageFile); fetch('/api/upload', { method: 'POST', body: formData }) .then(res => res.json()) .then(data => console.log('Live at:', data.fullUrl));

Python

import requests files = { 'html': open('index.html', 'rb'), 'css': open('styles.css', 'rb'), 'js': open('script.js', 'rb'), } data = {'pageName': 'my-portfolio'} response = requests.post( 'https://val.town/x/brybod123/Betlify/api/upload', data=data, files=files ) print(response.json()['fullUrl'])

Supported Asset Types

  • Images: PNG, JPG, GIF, SVG, WebP
  • Fonts: WOFF, WOFF2, TTF
  • Other: Any file type via base64

Technical Details

  • Storage: Val Town's blob KV cache for instant hosting
  • Runtime: Deno + TypeScript
  • Asset Encoding: Base64 data URIs (no separate HTTP requests)
  • MIME Types: Automatic detection
  • CSS Injection: Into HTML <head>
  • JS Injection: Before closing </body> tag
  • Performance: Cached retrieval, zero cold starts

What Makes Betlify Different

FeatureBetlifyTraditional Hosting
Upload methodDrag & drop folderManual file upload
File detectionAutomaticManual selection
Setup timeInstantMinutes
Asset handlingBase64 data URIsSeparate HTTP requests
No sub-requests needed
API availableOften extra cost
Custom domain supportShared URL

Made with ❤️ on Val Town