Skip to content

Commit

Permalink
template(spa): Provide example of server that can handle SPA routes
Browse files Browse the repository at this point in the history
Also, fix typo of "yo" -> "to".
  • Loading branch information
ngbrown committed Feb 9, 2024
1 parent dbebdf9 commit 85ac9b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions templates/spa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ npm run dev

## Production

When you are ready yo build a production version of your app, `npm run build` will generate your assets and an `index.html` for the SPA.
When you are ready to build a production version of your app, `npm run build` will generate your assets and an `index.html` for the SPA.

```shellscript
npm run build
```

You can serve this from any server of your choosing, for a simple example, you could use [http-server](https://www.npmjs.com/package/http-server):
### Deployment

You can then serve your app from any HTTP server of your choosing. The server should be configured to serve multiple paths from a single root `/index.html` file (commonly called "SPA fallback"). Other steps may be required if the server doesn't directly support this functionality.

For a simple example, you could use [sirv-cli](https://www.npmjs.com/package/sirv-cli):

```shellscript
npx http-server build/client/
npx sirv-cli build/client/ --single
```

[remix-vite-docs]: https://remix.run/docs/en/main/future/vite

0 comments on commit 85ac9b5

Please sign in to comment.