An example repository demonstrating Contentstack Launch integration with Astro.
This repository showcases:
- Server-Side Rendering (SSR) - Dynamic content generation on each request
- Incremental Static Regeneration (ISR) - Cached content with revalidation
- Static Site Generation (SSG) - Pre-built static pages
- API Routes - Server-side API endpoints
- Cache Control - Different caching strategies and cache purging
/
βββ public/
β βββ favicon.svg
βββ src/
β βββ assets/
β β βββ astro.svg
β β βββ background.svg
β βββ components/
β β βββ Welcome.astro
β βββ layouts/
β β βββ Layout.astro
β βββ pages/
β βββ index.astro # Demo dashboard
β βββ ssr-demo.astro # Server-Side Rendering demo
β βββ isr-demo.astro # Incremental Static Regeneration demo
β βββ ssg-demo.astro # Static Site Generation demo
β βββ ssr-api-demo.astro # API routes demo
β βββ cacheTags-purge-demo.astro # Cache purging demo
βββ astro.config.mjs # Astro configuration with Node adapter
βββ package.json
βββ tsconfig.json
- Astro ^5.13.5 - The web framework
- React ^19.1.1 - UI component library
- @astrojs/node ^9.4.3 - Node.js adapter for server deployment
- @astrojs/react ^4.3.0 - React integration
- TypeScript - Type safety and development experience
- Node.js >= 18.0.0
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd astro-ssr-test- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:4321
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm start |
Start the production server |
npm run astro ... |
Run CLI commands like astro add, astro check |
npm run astro -- --help |
Get help using the Astro CLI |
The project is configured for server-side rendering with the Node.js adapter:
// astro.config.mjs
export default defineConfig({
output: "server",
adapter: node({
mode: "standalone",
}),
integrations: [react()],
});npm run build
npm startThis project is licensed under the MIT License - see the LICENSE file for details.