项目实战01

Review

  1. 2023-03-26 10:22

一、Introduction #

  1. Koa
  2. Prisma
  3. MySQL
  4. TypeScript
  5. ESBuild
  6. Jest
  7. ESLint
  8. Nx
  9. Prettier
  10. PNPM

二、项目配置 #

npx create-nx-workspace@latest
pnpm install
pnpm add prisma -D
pnpm add @prisma/client

npx prisma init --datasource-provider mysql
npx prisma generate

config .env

DATABASE_URL="mysql://root:123456@192.168.0.206:3306/test"

Pull the schema from an existing database, updating the Prisma schema

npx prisma pull

Push the Prisma schema state to the database

npx prisma db push

配置Koa中间件

pnpm add koa

Reference #