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

https://github.com/drivly/edge-api

Simplified Edge API Router with JWT Auth, Logging, and Database
https://github.com/drivly/edge-api

Last synced: 3 months ago
JSON representation

Simplified Edge API Router with JWT Auth, Logging, and Database

Awesome Lists containing this project

README

        

# edge-api



Latest version on npm



Downloads on npm



Project license

Simplified Edge API Router with JWT Auth, Logging, and Database.

```javascript
import { API, error } from 'edge-api'

const api = API()

api
// .all('*', withUser, withDB({ database: 'API' }))
.get('/', () => ({ hello: 'api' }))
.get('/:resource', ({ resource }) => ({ resource }))
.get('/:resource/:id+', ({ resource, id }) => ({ resource, id }))
.all('*', () => error(404))

export default api
```