brf/server/routes/api/journals.ts

18 lines
391 B
TypeScript

import _ from 'lodash'
import type { FastifyPluginCallbackZod } from 'fastify-type-provider-zod'
import knex from '../../lib/knex.ts'
const journalRoutes: FastifyPluginCallbackZod = (fastify, _, done) => {
fastify.route({
url: '/',
method: 'GET',
handler() {
return knex('journal').select('*').orderBy('identifier')
},
})
done()
}
export default journalRoutes