Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bryanadamss/express-ts

🍢Rest API with JWT authentication and role based authorization using TypeScript Express.js and TypeORM;Fork on https://github.com/andregardi/jwt-express-typeorm
https://github.com/bryanadamss/express-ts

express rest restapi ts typeorm typescript

Last synced: 4 days ago
JSON representation

🍢Rest API with JWT authentication and role based authorization using TypeScript Express.js and TypeORM;Fork on https://github.com/andregardi/jwt-express-typeorm

Awesome Lists containing this project

README

        

# express-ts
🍢Rest API with JWT authentication and role based authorization using TypeScript Express.js and TypeORM;Base on https://github.com/andregardi/jwt-express-typeorm

## 开始
1. npm i
2. npm start
3. npm run migration:run
4. 使用postman测试(注意post请求header设置Content-Type :application/json并且body选择raw,参考https://github.com/andregardi/jwt-express-typeorm/issues/3)
5. 例如测试登录
```
// url
post /auth/login

// post body(raw)
{
"username": "admin",
"password": "admin"
}
```

## 参考
- 项目:https://github.com/andregardi/jwt-express-typeorm?source=post_page-----fbfa3cab22a4----------------------
- 文章:https://medium.com/javascript-in-plain-english/creating-a-rest-api-with-jwt-authentication-and-role-based-authorization-using-typescript-fbfa3cab22a4