Bun HTTP Server File Uploader: AI-Generated Code Prompt
CODE PREVIEW
エディタを読み込み中…
P
Prompt
Create a single-file Bun HTTP server (index.ts) that: - Serves static files from './public' folder (e.g., index.html) - Handles POST /upload to save uploaded files to './uploads' folder (use multipart form data) - Uses Bun's built-in fetch API and serve() - Returns a JSON response with filename and size on upload success - Has a simple HTML frontend (served as static) with a drag-and-drop file upload zone and a list of uploaded files (fetched via GET /files) - Include a simple GET /files endpoint that returns a JSON array of uploaded filenames - Use minimal styling (inline CSS) for a clean, modern look - Use only Bun standard library, no npm packages.
Bunの標準機能だけで作った超軽量HTTPサーバー。静的ファイル配信とファイルアップロードをサポート。npmパッケージは一切不要。ドラッグ&ドロップ対応のモダンなUIで、アップロードしたファイルの一覧表示も可能。Bunの高速なfetch/serveを活用。
Prompt Overview
A super lightweight HTTP server built with only Bun's standard features. Supports static file delivery and file upload. No npm packages required. Features a modern drag-and-drop UI with the ability to display a list of uploaded files. Leverages Bun's high-speed fetch/serve.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選