/** * Example usage of the authentication system * This file demonstrates how to integrate the auth system with Hono */ import { Hono } from "hono"; declare const app: Hono; export default app; /** * To run this example: * * 1. Install dependencies: * npm install hono effect bcrypt jose * * 2. Set up environment: * export NODE_ENV=development * export PORT=3000 * * 3. Initialize database: * node --import tsx/esm src/server/database/init-db.ts * * 4. Run the server: * node --import tsx/esm src/server/auth/example-usage.ts * * API Usage Examples: * * Register: * curl -X POST http://localhost:3000/api/auth/register \ * -H "Content-Type: application/json" \ * -d '{"username":"testuser","email":"test@example.com","password":"SecurePass123"}' * * Login: * curl -X POST http://localhost:3000/api/auth/login \ * -H "Content-Type: application/json" \ * -d '{"email":"test@example.com","password":"SecurePass123"}' \ * -c cookies.txt * * Access protected endpoint (with cookie): * curl http://localhost:3000/api/protected/profile \ * -b cookies.txt * * Access protected endpoint (with Bearer token): * curl http://localhost:3000/api/protected/profile \ * -H "Authorization: Bearer " * * Get current user: * curl http://localhost:3000/api/auth/me \ * -b cookies.txt * * Logout: * curl -X POST http://localhost:3000/api/auth/logout \ * -b cookies.txt */ //# sourceMappingURL=example-usage.d.ts.map