From f3375cfa200da0474c60de5d687e7a26691e4d01 Mon Sep 17 00:00:00 2001 From: michivonah Date: Sat, 13 Sep 2025 18:20:09 +0200 Subject: [PATCH] move routes to separate directory --- api/src/index.ts | 4 ++-- api/src/notification.ts | 15 --------------- api/src/{ => routes}/logbook.ts | 0 api/src/routes/notification.ts | 18 ++++++++++++++++++ 4 files changed, 20 insertions(+), 17 deletions(-) delete mode 100644 api/src/notification.ts rename api/src/{ => routes}/logbook.ts (100%) create mode 100644 api/src/routes/notification.ts diff --git a/api/src/index.ts b/api/src/index.ts index 12e0ddc..3c71653 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -1,7 +1,7 @@ import { Hono } from 'hono' import { bearerAuth } from 'hono/bearer-auth' -import notification from './notification' -import logbook from './logbook' +import notification from './routes/notification' +import logbook from './routes/logbook' import cronRouter from './jobs/cron' // create app diff --git a/api/src/notification.ts b/api/src/notification.ts deleted file mode 100644 index a78ae07..0000000 --- a/api/src/notification.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Hono } from 'hono' -import { dbConnection } from './db/client' -import { notificationMethod } from './db/schema' - -const app = new Hono() - -app.get('/list', (c) => { - return c.json( - { - message: 'List all notification methods' - } - ) -}) - -export default app \ No newline at end of file diff --git a/api/src/logbook.ts b/api/src/routes/logbook.ts similarity index 100% rename from api/src/logbook.ts rename to api/src/routes/logbook.ts diff --git a/api/src/routes/notification.ts b/api/src/routes/notification.ts new file mode 100644 index 0000000..6cf3575 --- /dev/null +++ b/api/src/routes/notification.ts @@ -0,0 +1,18 @@ +import { Hono } from 'hono' +import { getDbContext } from '../db/client' +import { notificationMethod, user, themepark } from '../db/schema' + +const app = new Hono() + +app.get('/list', async (c) => { + const db = getDbContext(c) + await db.insert(user).values({ username: 'notification'}); + //await db.insert(themepark).values({ name: 'Test', countrycode: 'CH'}); + return c.json( + { + message: 'List all notification methods' + } + ) +}) + +export default app \ No newline at end of file