@windingtree/org.id-test-http-server
v1.2.4
Published
Simple Http Server for ORGiD testing
Downloads
25
Readme
@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);