npm create astro@latest -- --template ssrThis example showcases server-side rendering with Astro using the @astrojs/node adapter and @astrojs/svelte integration.
Inside of your Astro project, you'll see the following folders and files:
/
├── public/
│ ├── favicon.ico
│ ├── favicon.svg
│ └── images/
├── src/
│ ├── components/
│ ├── models/
│ ├── pages/
│ │ ├── api/
│ │ └── products/
│ ├── styles/
│ └── api.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name. Dynamic routes like products/[id].astro are used to render individual product pages.
There's nothing special about src/components/, but that's where we like to put any Astro or framework components.
Any static assets, like images, can be placed in the public/ directory.
This project uses the @astrojs/node adapter with output: "server" to render pages on demand and expose API routes from src/pages/api/.
All commands are run from the root of the project, from a terminal:
Feel free to check our documentation or jump into our Discord server.
