API documentation for serve.negativefour.com.
All requests begin in the form:
{
token: <JWT token signed with internal api key>
}
The token signature is then checked. If the signature validates alright the token is unpacked and its contents are sent to the API endpoints.
This is a long winded way of saying that the API paramaters shown below must match the contents of the signed token you send.
/deploy
POST JSON body params:
{
name: <name of the webpage>,
repo: <link to git repo containing static webpage>,
}
POST JSON response:
{
jobID: <id for querying the status of the deploy job>
}
An invalid request will result in a JSON reponse containing an error field and the HTTP status code will be set appropriately.
{
error: <error message for the invalid request>
}
/delete
POST JSON body params:
{
name: <name of the webpage>,
user: <user email that controls name>
}
POST JSON response:
{
jobID: <id for querying the status of the undeploy job>
}
/status
GET JSON body params:
{
jobID: <previously provided jobID>,
}
GET JSON response:
{
stdout: <standard out from job so far>,
stderr: <standard err from job so far>,
exitCode: <present if job has exited - exit code of deploy script>,
serverError: <present if there was a server starting the script - contains error message>
}
An invalid request will result in a JSON reponse containing an error field and the HTTP status code will be set appropriately.
{
error: <error message for the invalid request>
}