@tbdex/http-server
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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')
})

Readme

Keywords

Package Sidebar

Install

npm i @tbdex/http-server

Weekly Downloads

186

Version

1.0.2

License

Apache-2.0

Unpacked Size

124 kB

Total Files

94

Last publish

Collaborators

  • tbd-releases
  • mistermoe