sites
SystemService::Sites
struct SystemService::Sites {
const psibase::AccountNumber service;
serveSys(...);
storeSys(...);
removeSys(...);
};
Provide web hosting.
This service provides web hosting to non-service accounts. It supports both an
upload UI (TODO) and command-line upload using psibase upload
.
Uploading a directory tree:
psibase -a $ROOT_URL -s $PVT_KEY upload -r -S $ACCOUNT sites $DIR /
Uploading a single file:
psibase -a $ROOT_URL -s $PVT_KEY upload -S $ACCOUNT sites
$PATH_TO_FILE /index.html
You don't need the -a
and -s
options if your running a local test chain at
http://psibase.127.0.0.1.sslip.io:8080/
and don't protect the accounts with keypairs.
After files are uploaded, the site is available at http://$ACCOUNT.$DOMAIN
SystemService::Sites::serveSys
std::optional<psibase::HttpReply> SystemService::Sites::serveSys(
psibase::HttpRequest request
);
SystemService::Sites::storeSys
void SystemService::Sites::storeSys(
std::string path,
std::string contentType,
std::vector<char> content
);
SystemService::Sites::removeSys
void SystemService::Sites::removeSys(
std::string path
);