Bun HTTP Server Starter: AI-Generated Code Example
CODE PREVIEW
Prompt
Create a minimal Bun HTTP server with routing, JSON response, and query param handling.
Bun(高速オールインワンJavaScriptランタイム)でミニマルなHTTPサーバーを作るデモです。JSONレスポンス、POSTボディのパース、クエリパラメータ、CORSヘッダーを内蔵 — 外部依存ゼロ。
起動方法: JSコードをserver.jsとして保存し、bun run server.jsを実行。エンドポイント例: GET /api/hello, POST /api/echo, GET /api/query?name=world。
Prompt Overview
This is a demo for creating a minimal HTTP server with Bun (a fast all-in-one JavaScript runtime). It includes JSON responses, POST body parsing, query parameters, and CORS headers — with zero external dependencies.
How to run: Save the JS code as server.js and execute bun run server.js. Example endpoints: GET /api/hello, POST /api/echo, GET /api/query?name=world.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選