dtube / avalon

Blockchain for social distribution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Organize the HTTP API

skzap opened this issue · comments

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 in src/http/block/index.js
  • the /rewards/* endpoints codes would be in src/http/reward/index.js, each endpoint could have it's own file in src/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.

This is essentially done. Needs to be tested / adjusted on windows