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

https://github.com/pilotak/openapi-typescript-jwt

Express.js OpenAPI 3 typescript JWT boilerplate
https://github.com/pilotak/openapi-typescript-jwt

authentication express jwt nodejs openapi openapi3 typescript

Last synced: 3 months ago
JSON representation

Express.js OpenAPI 3 typescript JWT boilerplate

Awesome Lists containing this project

README

          

# OpenAPI 3 TypeScript JWT template
An example API with TypeScript support and basic login mechanism based on JWT

## Install
```sh
npm install && npm run dev
```

## Run
First login and copy generated token.

```sh
curl -H 'Accept: application/json' -X POST -d 'username=test' http://localhost:3000/v1/login
```

Now you can see openapi.json
```sh
curl -H 'Accept: application/json' -X GET -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' http://localhost:3000/v1/docs
```

Or you can list users
```sh
curl -H 'Accept: application/json' -X GET -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' http://localhost:3000/v1/users
```

## GUI
Just visit `redoc.html` via your browser