edge-api

0.1.69 • Public • Published

edge-api

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i edge-api

Weekly Downloads

0

Version

0.1.69

License

MIT

Unpacked Size

57.3 kB

Total Files

48

Last publish

Collaborators

  • nathanclevenger