Look at the Nuxt documentation to learn more.
Make sure to install dependencies:
npm install# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npm install prisma -g
$ npm install @prisma/client
$ npx prisma generate- *** ใช้ฐานข้อมูล ในเครื่องตัวเอง
# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npx prisma migrate reset
$ npx prisma migrate dev --name init# Table: T_Users
# รันคำสั่งนี้แค่ครั้งแรก ของการติดตั้งโปรแกรม
$ npm run seed- คำสั่งอื่นๆ
# เรียกใช้ Prisma Studio เพื่อใช้แก้ไขข้อมูลในฐานข้อมูล
$ npx prisma studio# สร้างไฟล์มิกเรตใหม่ อัปเดตฐานข้อมูล
$ npx prisma migrate dev# init คือชื่อของการ migrate ตัวอย่าง
$ npx prisma migrate dev --name create_signinlogs_tableStart the development server on http://localhost:3000:
npm run devBuild the application for production:
npm run buildLocally preview production build:
npm run previewInstall prisma global
npm install -g prisma@6.7.0Install seed
npm run seedServer api best practices
server/
├── api/
│ └── v1/
│ └── users/
│ ├── index.get.ts // GET ดึงรายชื่อผู้ใช้ทั้งหมด (List)
│ ├── index.post.ts // POST สร้างผู้ใช้ใหม่ (Create)
│ ├── [id].get.ts // GET ดูรายละเอียดรายคน (Detail)
│ ├── [id].put.ts // PUT แก้ไขข้อมูล (Update)
│ └── [id].delete.ts // DELETE ลบผู้ใช้ (Delete)- ไม่ควรใช้ Vetur ให้ใช้ Volar
- Vetur ไม่รองรับ Top-level await ใน script setup
Check out the deployment documentation for more information.
