File
Blob: worker/src/server/routes/access.ts
| 1 | import { Hono } from 'hono'; |
| 2 | import { loginSchema } from '@/shared/contracts/signaling.ts'; |
| 3 | import { login } from '@/server/auth.ts'; |
| 4 | import type { HttpApp } from '@/server/http.ts'; |
| 5 | import { input, result, room } from './context.ts'; |
| 6 | |
| 7 | const app = new Hono<HttpApp>(); |
| 8 | app.post('/login', async (c) => login((await input(c, loginSchema)).password, c)); |
| 9 | app.get('/status', async (c) => result(c, await room(c).getStatus())); |
| 10 | |
| 11 | export default app; |