mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 19:03:24 +00:00
Replace KV storage with D1, add peer_id field, simplify README
Storage changes: - Remove KV storage adapter - Add D1 storage adapter for Cloudflare Workers - Update schema to use peer_id instead of info field - Add database migrations for D1 Documentation: - Simplify README to be more concise - Update deployment instructions for D1 - Add D1_SETUP.md explaining migration from KV - Update DEPLOYMENT.md with D1 setup steps API changes: - Replace info field with peerId in session creation - Update all storage interfaces and implementations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { createApp } from './app.ts';
|
||||
import { KVStorage } from './storage/kv.ts';
|
||||
import { D1Storage } from './storage/d1.ts';
|
||||
|
||||
/**
|
||||
* Cloudflare Workers environment bindings
|
||||
*/
|
||||
export interface Env {
|
||||
SESSIONS: KVNamespace;
|
||||
DB: D1Database;
|
||||
SESSION_TIMEOUT?: string;
|
||||
CORS_ORIGINS?: string;
|
||||
}
|
||||
@@ -15,8 +15,8 @@ export interface Env {
|
||||
*/
|
||||
export default {
|
||||
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
|
||||
// Initialize KV storage
|
||||
const storage = new KVStorage(env.SESSIONS);
|
||||
// Initialize D1 storage
|
||||
const storage = new D1Storage(env.DB);
|
||||
|
||||
// Parse configuration
|
||||
const sessionTimeout = env.SESSION_TIMEOUT
|
||||
|
||||
Reference in New Issue
Block a user