mirror of
https://github.com/michivonah/themepark-assistant.git
synced 2025-12-22 22:16:29 +01:00
move routes to separate directory
This commit is contained in:
parent
d60650a3a5
commit
f3375cfa20
4 changed files with 20 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { Hono } from 'hono'
|
import { Hono } from 'hono'
|
||||||
import { bearerAuth } from 'hono/bearer-auth'
|
import { bearerAuth } from 'hono/bearer-auth'
|
||||||
import notification from './notification'
|
import notification from './routes/notification'
|
||||||
import logbook from './logbook'
|
import logbook from './routes/logbook'
|
||||||
import cronRouter from './jobs/cron'
|
import cronRouter from './jobs/cron'
|
||||||
|
|
||||||
// create app
|
// create app
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
18
api/src/routes/notification.ts
Normal file
18
api/src/routes/notification.ts
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue