# Gatsby





Gatsby generates static files to `public/` by default.

Deploy [#deploy]

<Steps>
  <Step>
    Build your project [#build-your-project]

    ```bash
    npm run build
    ```

    Or with the Gatsby CLI:

    ```bash
    gatsby build
    ```
  </Step>

  <Step>
    Deploy to Sample.app [#deploy-to-sampleapp]

    ```bash
    samplex deploy ./public
    ```
  </Step>
</Steps>

<Callout type="warn">
  Gatsby outputs to `public/`, which is not auto-detected by the CLI. You must specify the directory
  explicitly.
</Callout>

Client-side routing [#client-side-routing]

Gatsby uses `@reach/router` internally. Sample.app's SPA fallback handles client-only routes automatically, but statically generated pages are served directly as HTML.

<Callout type="info">
  Gatsby pre-renders each page as HTML, so most routes work without SPA fallback. Only client-only
  routes (created with `createPage` and `matchPath`) rely on it.
</Callout>
