# `Arc.Plug.SinglePage`
[🔗](https://github.com/Cratis/Arc.Elixir/blob/main/lib/arc/plug/single_page.ex#L4)

Serves a single-page application: static files from a directory, and the `index.html` for
every other `GET` that accepts HTML, so client-side routes survive a refresh.

    plug Arc.Plug, application: MyApp.Arc
    plug Arc.Plug.SinglePage, root: "priv/static/app"

Place it after `Arc.Plug` so API routes are answered first. Paths under `/api/` and
`/.cratis/` are never served as the SPA.

## Options

  * `:root` - (required) the directory holding the built frontend, relative to the working
    directory or absolute
  * `:index` - the index document; default `"index.html"`
  * `:api_prefixes` - path prefixes that must 404 instead of falling back; default `["/api/", "/.cratis/"]`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
