Page MenuHomePhabricator

[alias-server] Refactor to support unit testing of API endpoints
ClosedPublic

Authored by bytesofman on Jun 23 2023, 16:52.

Details

Summary

T3060

Refactor to support unit testing of API endpoints.

Following express documentation and mochajs example at https://github.com/mochajs/mocha-examples/tree/master/packages/express-rest-api

Remove the express app from main.js. Refactor index.js so that the app initializes the db first before passing this to the express server and the indexer.

Add unit test for existing API endpoint.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable