Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

1.0 KB
Raw Blame
// PR Preview Environments — per-app preview list, settings, and lifecycle ops.
// Mounted under /apps on the backend.

export async function getPreviews(appId) {
    return this.request(`/apps/${appId}/previews`);
}

export async function getPreviewSettings(appId) {
    return this.request(`/apps/${appId}/previews/settings`);
}

export async function updatePreviewSettings(appId, body) {
    return this.request(`/apps/${appId}/previews/settings`, { method: 'PUT', body });
}

export async function syncPreviews(appId) {
    return this.request(`/apps/${appId}/previews/sync`, { method: 'POST' });
}

export async function redeployPreview(appId, previewId) {
    return this.request(`/apps/${appId}/previews/${previewId}/redeploy`, { method: 'POST' });
}

export async function destroyPreview(appId, previewId) {
    return this.request(`/apps/${appId}/previews/${previewId}`, { method: 'DELETE' });
}

export async function createPreview(appId, pr) {
    return this.request(`/apps/${appId}/previews`, { method: 'POST', body: pr });
}