Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Files

Latest commit

cbcf6cf · Sep 3, 2024

History

History

http-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 30, 2024
Jul 30, 2024
Apr 5, 2024
Sep 12, 2023
Sep 12, 2023
Sep 3, 2024
Sep 12, 2023
Sep 12, 2023
Jun 13, 2024
Sep 3, 2024
Feb 16, 2024

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