HomePhabricator

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

Description

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

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14113

Details

Provenance
bytesofmanAuthored on Jun 23 2023, 16:51
bytesofmanPushed on Jun 24 2023, 19:39
Reviewer
Restricted Project
Differential Revision
D14113: [alias-server] Refactor to support unit testing of API endpoints
Parents
rABC76b1f0e05319: [Cashtab] Move the token urls config out of Ticker.js
Branches
Unknown
Tags
Unknown