common-api
SystemService::CommonApi
struct SystemService::CommonApi {
const psibase::AccountNumber service; // "common-api"
serveSys(...); // This is a standard action that allows common-api to serve http requests.
storeSys(...); // This is a standard action that allows files to be stored in common-api
};
Services that contains the common files and libraries used by apps on psibase.
See HTTP requests and JS libraries
SystemService::CommonApi::serveSys
std::optional<psibase::HttpReply> SystemService::CommonApi::serveSys(
psibase::HttpRequest request
);
This is a standard action that allows common-api to serve http requests..
common-api responds to GET requests:
- /common/thisservice
- /common/rootdomain
- /common/tapos/head and to POST requests:
- /common/pack/Transaction
- /common/pack/SignedTransaction
Additionally, common-api will serve content at any path stored using storeSys
SystemService::CommonApi::storeSys
void SystemService::CommonApi::storeSys(
std::string path,
std::string contentType,
std::vector<char> content
);
This is a standard action that allows files to be stored in common-api.
These files can later be retrieved using serveSys
.