A progressive Node.js framework for building efficient and scalable server-side applications.
A nest websocket example with auth.
实现了websocket连接鉴权、心跳保活、私聊和系统主动推送通知等逻辑
# install
$ pnpm up -latest
# .env
$ cp .env.example .env # modify the config with yours
# run migration
$ pnpm typeorm:run-migrations
# development
$ pnpm start
# watch mode
$ pnpm start:dev
the test users Jim and John are auto generated on nest start, look at OnApplicationBootstrap
$ curl -X POST \
'127.0.0.1:3000/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "Jim",
"password": "123456"
}'
$ curl -X POST \
'127.0.0.1:3000/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "John",
"password": "123456"
}'
Nest is MIT licensed.