nestjs の API のサンプル
cd ./infrastructure/docker
docker network create nestjs-sample
docker-compose up -d
cd ../../
cd ./env
cp develop.env .env
cp test.env .env.test
cd ../
cd ./key
ssh-keygen -t rsa -b 4096 -m PEM -f sample_jwt
ssh-keygen -f sample_jwt.pub -e -m pem > sample_jwt.pub_
rm sample_jwt.pub
mv sample_jwt.pub_ sample_jwt.pub
cd ../
npm run start
curl -X GET http://localhost:3001/users
curl -X GET http://localhost:3001/users/1
curl -X POST http://localhost:3001/users/create -d 'name=boko' -d 'age=11'
本当は entity に依存させるべきではないが今回は使ってる。
npm run test:e2e
npm i -D jest typescript ts-jest @types/jest
npm i -D @nestjs/cli @nestjs/schematics @nestjs/testing @types/express @types/node @types/passport-jwt @types/supertest @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-standard-with-typescript eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard prettier supertest ts-loader ts-node tsconfig-paths
npm i @nestjs/common @nestjs/config @nestjs/core @nestjs/jwt @nestjs/passport @nestjs/platform-express class-transformer class-validator mysql passport passport-jwt reflect-metadata rimraf rxjs typeorm