Browse a Worker's code
const url = 'https://digize.com/api/v1/sites/example/code';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://digize.com/api/v1/sites/example/code \ --header 'x-api-key: <x-api-key>'A folder’s files or one file in a Worker’s git repo, at a branch, tag or commit: the newest commit on its deploy branch unless it says. A folder comes with its README, and a text file or image with its content. kind is empty before the first push; null when there’s no such ref or path.
Needs the sites:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”A branch, tag or commit id. Left out, the Worker’s deploy branch.
A branch, tag or commit id. Left out, the Worker’s deploy branch.
A path in the repo, such as src/index.ts. Left out, the top.
A path in the repo, such as src/index.ts. Left out, the top.
Responses
Section titled “Responses”Done
object
object
object
object
object
object
object
object
object
object
object
In bytes; null when it’s too large to read.
Text as it is, an image in base64, or null for other binary files and ones too large to show.
Where a symbolic link points, or the commit a submodule is at.
Example
{ "kind": "empty"}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}