• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
flymaster

flymaster

Images

Public
Like
Images
Home
Code
3
backend
2
frontend
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
index.ts
https://flymaster--30c40466c6fb11f0953942dde27851f2.web.val.run
README.md

Simple Image Hosting Site

A minimal image hosting service that displays the last 4 uploaded images.

✅ Current Status: WORKING

The application is fully functional with images displaying correctly on the home page.

Features

  • / - View the last 4 uploaded images (newest first)
  • /add - Upload form for new images (no navigation links to this page)
  • Automatic cleanup: images are deleted when there are 4 newer images
  • Mobile and desktop friendly
  • No frontend JavaScript required
  • File size limit: 10MB per image
  • Supports common image formats (JPEG, PNG, GIF, WebP)

Technical Details

  • Built with Hono framework
  • Uses SQLite for metadata storage (filename, content type, file size, upload date)
  • Uses Val Town Blob storage for image files (stored as base64)
  • Images are automatically cleaned up when more than 4 are uploaded
  • Responsive design with CSS Grid and Flexbox
  • Server-side rendering with no client-side JavaScript
  • Upload functionality available but not linked from the UI
  • Fixed base64 encoding/decoding for proper image handling

Structure

  • backend/index.ts - Main application entry point (HTTP trigger)
  • backend/database/migrations.ts - Database schema initialization
  • backend/database/queries.ts - Database operations and image management
  • frontend/style.css - Responsive CSS styling

Usage

  1. Visit the root URL to see uploaded images
  2. The /add endpoint provides upload functionality but is not linked from the main interface
  3. Images can be uploaded by directly accessing /add
  4. Only the 4 most recent images are kept; older images are automatically deleted

API Endpoints

  • GET / - Home page with image gallery (no upload links)
  • GET /add - Upload form page (no navigation links)
  • POST /add - Handle image upload (multipart/form-data)
  • GET /image/:blobKey - Serve individual images with proper content types
  • GET /frontend/style.css - CSS stylesheet

Recent Fixes

  • Fixed base64 encoding for large images using chunked processing
  • Fixed blob data retrieval to handle Response objects correctly
  • Improved error handling for image serving
  • Removed debug endpoints for production use
HTTP
  • index.ts
    flymaster--30…f2.web.val.run
Code
backendfrontendREADME.md
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.