dreamdevil00 / nest-authz-example

Node-Casbin authorization example for Nest.js via auth middleware: https://github.com/node-casbin/nest-authz

Home Page:https://github.com/node-casbin/nest-authz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nest-authz-example

Commitizen friendly

Description

A demo shows how to use nest-authz to implement role-based access control.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Open http://localhost:3000/api to see api. The api uses Bear auth schema, so if you want to access protected api, you should click the Authorize button and set Bearer yourjwttoken after login.

Test

# unit tests
$ npm run test

License

MIT licensed.

About

Node-Casbin authorization example for Nest.js via auth middleware: https://github.com/node-casbin/nest-authz

https://github.com/node-casbin/nest-authz

License:MIT License


Languages

Language:TypeScript 100.0%