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
- Host: GitHub
- URL: https://github.com/drivly/edge-api
- Owner: drivly
- License: mit
- Created: 2023-06-08T07:03:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-14T17:55:05.000Z (about 1 year ago)
- Last Synced: 2025-02-16T15:16:55.955Z (3 months ago)
- Language: JavaScript
- Size: 350 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# edge-api
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
```