Skip to main content

Deploy Astro on WebStadia

Astro is a great fit for WebStadia — it generates static HTML by default.

Build settings

SettingValue
Build Commandnpm run build
Publish Directorydist

Using WebStadia Data Tables as a CMS

Astro's content layer pairs well with WebStadia Data Tables. Fetch your data at build time:

---
// src/pages/blog.astro
const response = await fetch('https://api.webstadia.com/v1/dt/YOUR_TABLE_ID')
const posts = await response.json()
---

<html>
<body>
<h1>Blog</h1>
{posts.map(post => (
<article>
<h2>{post.Title}</h2>
<p>{post.Excerpt}</p>
</article>
))}
</body>
</html>

Environment variables

Prefix public variables with PUBLIC_:

PUBLIC_API_URL=https://api.example.com
const apiUrl = import.meta.env.PUBLIC_API_URL