Nuxt 초기 세팅 추가

This commit is contained in:
2026-04-29 14:54:44 +09:00
parent efc7955415
commit 37f6c38caa
60 changed files with 12698 additions and 34 deletions

View File

@@ -0,0 +1,20 @@
import { getSamplePostBySlug } from '../../utils/sample-content'
/**
* 공개 게시물 상세 API
* @param {import('h3').H3Event} event - 요청 이벤트
* @returns {Object} 게시물 상세
*/
export default defineEventHandler((event) => {
const slug = getRouterParam(event, 'slug')
const post = getSamplePostBySlug(slug)
if (!post) {
throw createError({
statusCode: 404,
statusMessage: '게시물을 찾을 수 없습니다'
})
}
return post
})