This template deploys a server-side rendered Astro application on Render.
- Server-side rendering: Pages render on every request
- API routes: JSON endpoints with GET and POST handlers
- Tailwind CSS v4: Modern styling via Vite plugin
- Standalone mode: No Express needed
npm install
npm run devThe app runs at http://localhost:4321.
| Script | Description |
|---|---|
npm run dev |
Start the development server with hot reload |
npm run build |
Build for production |
npm run preview |
Preview the production build locally |
npm run server |
Run the production server |
The homepage demonstrates two SSR features:
- Server-rendered data: A timestamp and request ID that change on every page refresh, compared to a live client-side clock
- API routes: An interactive form that calls
/api/helloand displays the JSON response
├── src/
│ ├── layouts/
│ │ └── Layout.astro
│ ├── pages/
│ │ ├── index.astro
│ │ └── api/
│ │ └── hello.ts
│ └── styles/
│ └── global.css
├── public/
├── astro.config.mjs
├── tsconfig.json
├── render.yaml
└── package.json
The template includes an example endpoint at /api/hello:
curl http://localhost:4321/api/hello?name=Astro{
"message": "Hello, Astro!",
"timestamp": "2026-01-16T12:00:00.000Z",
"method": "GET"
}Astro uses file-based routing:
src/pages/about.astro→/aboutsrc/pages/blog/[slug].astro→/blog/:slugsrc/pages/api/users.ts→/api/users