Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/textbook/spa-config-ssi
Demonstration of using server-side includes to inject runtime configuration to a single-page app
https://github.com/textbook/spa-config-ssi
cloud-foundry configuration continuous-delivery create-react-app javascript nginx react server-side-includes single-page-app staticfile
Last synced: 4 days ago
JSON representation
Demonstration of using server-side includes to inject runtime configuration to a single-page app
- Host: GitHub
- URL: https://github.com/textbook/spa-config-ssi
- Owner: textbook
- License: isc
- Created: 2020-04-30T07:53:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:39:25.000Z (almost 2 years ago)
- Last Synced: 2024-04-11T15:43:10.262Z (7 months ago)
- Topics: cloud-foundry, configuration, continuous-delivery, create-react-app, javascript, nginx, react, server-side-includes, single-page-app, staticfile
- Language: JavaScript
- Size: 3.86 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SPA Config SSI
Demonstration of using server-side includes to inject runtime configuration to a single-page app.
## Notes
- Bootstrapped using [Create React App]
- **Requires** `html-minifier-terser` of at least 5.1.0 (see this [Pull Request]) or explicit
configuration to leave SSI comments in HTML (can be done via `webpack-html-plugin` but not in
CRA)
- Set up for deployment to [Cloud Foundry]## Usage
This demo includes two sets of configuration:
- development (in `src/configuration.js`); and
- production (in `public/config.html`).The SSI directive in `public/index.html` is replaced by the content of `public/config.html` at
runtime, if SSI is enabled on the server (the included `Staticfile` does this for the Nginx used
in the [Staticfile buildpack]).To run locally with the development configuration:
```bash
npm start
```To deploy to CF with the production configuration, using the [CF CLI]:
```bash
npm run build && cf push
```[CF CLI]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
[Cloud Foundry]: https://cloudfoundry.org/
[Create React App]: https://github.com/facebook/create-react-app/
[Pull Request]: https://github.com/DanielRuf/html-minifier-terser/pull/39
[Staticfile buildpack]: https://docs.cloudfoundry.org/buildpacks/staticfile/index.html