localflare-server
v0.1.2
Published
Dashboard API server for Localflare
Downloads
602
Maintainers
Readme
localflare-server
Dashboard API server for Localflare. Provides a Hono-based REST API for interacting with Cloudflare Worker bindings.
Overview
This package provides the API server that powers the Localflare dashboard:
- REST API - Full CRUD operations for all Cloudflare bindings
- Hono Framework - Fast, lightweight HTTP server
- Real-time Updates - WebSocket support for live data streaming
Installation
npm install localflare-server
# or
pnpm add localflare-serverUsage
import { createDashboardServer } from 'localflare-server';
import { LocalFlareCore } from 'localflare-core';
const core = new LocalFlareCore({ configPath: './wrangler.toml' });
await core.start();
const server = createDashboardServer({
core,
port: 8788
});
await server.start();API Endpoints
D1 Database
GET /api/d1- List all D1 databasesGET /api/d1/:name/tables- List tables in a databasePOST /api/d1/:name/query- Execute SQL query
KV Namespace
GET /api/kv- List all KV namespacesGET /api/kv/:name/keys- List keys in a namespaceGET /api/kv/:name/:key- Get a valuePUT /api/kv/:name/:key- Set a valueDELETE /api/kv/:name/:key- Delete a key
R2 Bucket
GET /api/r2- List all R2 bucketsGET /api/r2/:name/objects- List objects in a bucketGET /api/r2/:name/:key- Get an objectPUT /api/r2/:name/:key- Upload an objectDELETE /api/r2/:name/:key- Delete an object
Queues
GET /api/queues- List all queuesPOST /api/queues/:name/send- Send a message to a queue
Durable Objects
GET /api/do- List Durable Object namespacesGET /api/do/:namespace/instances- List instances
Related Packages
| Package | Description |
|---------|-------------|
| localflare | CLI tool (main package) |
| localflare-core | Miniflare wrapper and config parser |
| localflare-dashboard | React dashboard UI |
License
MIT
