switch to monorepo structure

This commit is contained in:
2025-05-06 11:00:35 +01:00
parent e1f927ad27
commit 07b7f1b51f
63 changed files with 2440 additions and 1011 deletions

View File

@@ -0,0 +1,31 @@
import { authenticated, login, logout, signUp } from "./auth/auth.ts"
import { startBackgroundSessionCleanup } from "./auth/session.ts"
import { listUserBookmarks } from "./bookmark/handlers.ts"
import { migrateDatabase } from "./database.ts"
import { httpHandler } from "./http-handler.ts"
import { createDemoUser } from "./user/user.ts"
function main() {
migrateDatabase()
createDemoUser()
startBackgroundSessionCleanup()
Bun.serve({
routes: {
"/api/login": {
POST: httpHandler(login),
},
"/api/sign-up": {
POST: httpHandler(signUp),
},
"/api/logout": {
POST: authenticated(logout),
},
"/api/bookmarks": {
GET: authenticated(listUserBookmarks),
},
},
})
}
main()