common-sys
SystemService::CommonSys
struct SystemService::CommonSys {
const psibase::AccountNumber service; // "common-sys"
serveSys(...); // This is a standard action that allows common-sys to serve http requests.
storeSys(...); // This is a standard action that allows files to be stored in common-sys
};
Services that contains the common files and libraries used by apps on psibase.
See HTTP requests and JS libraries
SystemService::CommonSys::serveSys
std::optional<psibase::HttpReply> SystemService::CommonSys::serveSys(
psibase::HttpRequest request
);
This is a standard action that allows common-sys to serve http requests..
common-sys responds to GET requests:
- /applet/APPLET_NAME
- /common/thisservice
- /common/rootdomain
- /common/tapos/head and to POST requests:
- /common/pack/Transaction
- /common/pack/SignedTransaction
When responding to the /applet/APPLET_NAME GET request, then common-sys returns
the file stored at the root index. That file reads the URL bar, detects that an
applet is being loaded, and request the applet to load inside an iframe.
Additionally, common-sys will serve content at any path stored using storeSys
SystemService::CommonSys::storeSys
void SystemService::CommonSys::storeSys(
std::string path,
std::string contentType,
std::vector<char> content
);
This is a standard action that allows files to be stored in common-sys.
These files can later be retrieved using serveSys.