Organize the HTTP API
skzap opened this issue · comments
heimindanger commented
The src/http.js
(HTTP API) is starting to be huge. Also everyone more or less added some calls for his own purposes (see techcoder extended API).
I think it would be nice to split the API into multiple files, and why not modularize it so that anyone can add/remove each endpoint easily.
examples:
- the
/block
endpoint code would be insrc/http/block/index.js
- the
/rewards/*
endpoints codes would be insrc/http/reward/index.js
, each endpoint could have it's own file insrc/http/reward/
Avalon would by default use all the files in the src/http/
folder. Removing an endpoint would be as easy as deleting a folder. Adding an endpoint could be done via git submodule.
heimindanger commented
heimindanger commented
This is essentially done. Needs to be tested / adjusted on windows
Hightouch commented
I just tested it on windows and everything seems fine.