@windingtree/org.id-test-http-server
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

@windingtree/org.id-test-http-server

@windingtree/org.id-test-http-server

Simple Http Server for ORGiD protocol testing

Setup

npm install @windingtree/org.id-test-http-server

Usage

import HttpFileServer from '@windingtree/org.id-test-http-server';

// HttpFileServer can be used for testing cases where it is required to host files
const httpServer = new HttpFileServer();
httpServer.start()
  .then(() => {
    const file = {
      type: 'json',
      path: '<path_with_name>.json',
      content: '{"test": "test"}'
    };
    httpServer.addFile(file);

    const { data } = await axios.get(`${httpServer.baseUri}/${file.path}`);
    console.log(data);
    // {"test": "test"}

  })
  .catch(console.error);

Documentation

Generated docs

Package Sidebar

Install

npm i @windingtree/org.id-test-http-server

Weekly Downloads

1

Version

1.2.4

License

MIT

Unpacked Size

10.6 kB

Total Files

6

Last publish

Collaborators

  • kostysh
  • kvakes
  • tomashq