import { createRouter, defineEventHandler, useBase } from 'h3'
import * as DynamicArticleCtrl from '~/server/models/articles'

const router = createRouter()

router.get('/get-by-id/:id', defineEventHandler(DynamicArticleCtrl.getArticleById))
router.get('/get-by-slug/:slug', defineEventHandler(DynamicArticleCtrl.getArticleBySlug))
router.post('/condition', defineEventHandler(DynamicArticleCtrl.listArticleCondition))
export default useBase('/api/articles', router.handler)
