Sites
Manages a site's static files and configuration (which protocols to seed to, domain, etc.)
These are authenticated endpoints. Requests to these endpoints
must include a JWT Bearer
token in the header of the request.
Please see the documentation on
authorization for how to go about obtaining
a valid JWT token.
Getting the information of a site
/v1/sites/:domain
Takes a single path parameter domain
and
returns the configuration and info about the site.
Making a site
/v1/sites
Takes a JSON payload containing the domain of the site along with which protocols to seed to.
type InputPayload = {
"domain": string,
"public": boolean | undefined, // defaults to `false`
"protocols": {
"http": boolean,
"hyper": boolean,
"ipfs": boolean
}
}
Note that this does not include the actual site content itself. See the endpoint for uploading content to do that.
Deleting a site
/v1/sites/:domain
Takes a single path parameter domain
and deletes the site.
Updating a site's configuration
/v1/sites/:domain
Takes a single path parameter domain
and a JSON payload containing details about
which protocols to seed to.
type InputPayload = Partial<{
"protocols": {
"http": boolean,
"hyper": boolean,
"ipfs": boolean
},
"public": boolean
}>
Uploading content to a site
/v1/sites/:domain
/v1/sites/:domain
Takes a single path parameter domain
and uploads the attached tarball as the site content.
The body must be of type multipart/form-data
with a single tar.gz
file which will get extracted out and served.
Using the PUT
endpoint will delete any existing files before uploading the new files.
PATCH
on the other hand, will only upload new files in the tarball.
Listing all sites
/v1/sites
Only available if useWebringDirectoryListing
is set to true
on startup.
type ResultPayload = string[] // ID of all publishers