Upload a ZIP and deploy it from a hosting integration. Use the client from Client setup, and replace your-workspace with your workspace name.
tiiny.jstiiny.py
import { createZip } from "stackmachine";
// A hosting integration can upload a file map or a local directory.
const zip = await createZip({ "index.html": "<h1>Hello from Tiiny</h1>" });
const uploadUrl = await client.files.upload(zip);
const deployment = await client.deployments.create({
appName: "tiiny-demo",
owner: "your-workspace",
uploadUrl,
});
const appVersion = await deployment.wait({
onProgress: (event) => console.log(event.stream, event.message),
});
console.log(appVersion.app.url);from stackmachine import create_zip
# A hosting integration can upload a file map or a local directory.
zip_file = create_zip({"index.html": "<h1>Hello from Tiiny</h1>"})
upload_url = client.files.upload(zip_file)
deployment = client.deployments.create(
app_name="tiiny-demo", owner="your-workspace", upload_url=upload_url,
)
app_version = deployment.wait(
on_progress=lambda event: print(event.stream, event.message),
)
print(app_version.app.url)Source: stackmachine/sdks examples.