@leordev-tbdex/http-server
v0.27.3
Published
A configurable implementation of the [tbdex http api draft specification](https://github.com/TBD54566975/tbdex-protocol/blob/main/rest-api/README.md)
Downloads
17
Readme
tbdex http server
A configurable implementation of the tbdex http api draft specification
This repo is currently under construction 🚧
Installation
npm install @tbdex/http-server
Usage
import { TbdexHttpServer } from '@tbdex/http-server'
const api = new TbdexHttpServer()
api.get('offerings', async (ctx, filter) => { /* write biz logic here */ })
api.get('exchanges', async (ctx, filter) => { /* write biz logic here */ })
api.submit('rfq', async (ctx, message) => { /* write biz logic here */ })
api.submit('order', async (ctx, message) => { /* write biz logic here */ })
api.submit('close', async (ctx, message) => { /* write biz logic here */ })
await api.listen(9000, () => {
console.log('Server listening on port 9000')
})