Sample.app
Framework Guides

Gatsby

Deploy a Gatsby project to Sample.app.

Gatsby generates static files to public/ by default.

Deploy

Build your project

npm run build

Or with the Gatsby CLI:

gatsby build

Deploy to Sample.app

samplex deploy ./public

Gatsby outputs to public/, which is not auto-detected by the CLI. You must specify the directory explicitly.

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.

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.

On this page