import { createRouter, defineEventHandler, useBase } from 'h3'
import * as DynamicPageCtrl from '~/server/models/dynamic-page'

const router = createRouter()

router.get('/get-by-code/:slug', defineEventHandler(DynamicPageCtrl.getDynamicPageByCode))
router.get('/get-by-id/:id', defineEventHandler(DynamicPageCtrl.getDynamicPageById))

export default useBase('/api/dynamic-page', router.handler)
