Files
nuxt4-deep/server/api/01-hello.get.ts
hyeonggil fc7d3d14cf Add initial Nuxt 4 project setup with essential configurations
- Created .gitignore to exclude build outputs, logs, and environment files.
- Added nuxt.config.ts for project configuration, enabling Tailwind CSS and Pinia modules.
- Initialized package.json with scripts for development and production, and added necessary dependencies.
- Generated pnpm-lock.yaml for dependency management.
- Created README.md with setup instructions and development guidelines.
- Implemented server API examples in server/api/ directory, demonstrating various use cases.
- Added middleware for logging requests and responses.
- Included example Vue components and pages for server API interaction.
- Established basic project structure for Nuxt 4 application development.
2026-04-08 23:59:29 +09:00

15 lines
423 B
TypeScript

/**
* 케이스 1: 기본 GET 엔드포인트
*
* - 파일명에 .get.ts 접미사 → GET 요청만 처리
* - URL: GET /api/01-hello
* - eventHandler()로 요청 핸들러 정의
* - 객체/문자열/숫자 모두 반환 가능 (자동 JSON 직렬화)
*/
export default defineEventHandler(() => {
return {
message: "안녕하세요! Nitro 서버입니다.",
timestamp: new Date().toISOString(),
};
});