https://github.com/manekinekko/angular-ssr-swa
https://github.com/manekinekko/angular-ssr-swa
angular azure azure-static-web-apps server-side-rendering ssr swa
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/manekinekko/angular-ssr-swa
- Owner: manekinekko
- Created: 2020-05-20T11:56:23.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T06:28:44.000Z (over 2 years ago)
- Last Synced: 2025-03-29T00:25:57.723Z (22 days ago)
- Topics: angular, azure, azure-static-web-apps, server-side-rendering, ssr, swa
- Language: HTML
- Homepage: https://blue-bay-00cc1f303.azurestaticapps.net
- Size: 386 KB
- Stars: 22
- Watchers: 2
- Forks: 3
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-azure-static-web-apps - Publish a server-side rendered Angular app with Azure Static Web Apps
README
# Angular Server Side Rendering on Azure Static Web Apps
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.0-next.6.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
# Deploying to Azure Static Web Apps
Follow the [Quickstart](https://bit.ly/2ABy9Cb) guide for Azure Static Web Apps and use the following configuration:



By default, Azure Static Web Apps will execute the `npm run build` script. We need to update the [generated workflow file](https://github.com/manekinekko/angular-ssr-swa/blob/master/.github/workflows/azure-static-web-apps-blue-bay-00cc1f303.yml#L30) and explicitely run the `npm run prerender` script:

After saving and commiting our changes, another build will trigger and we should get the prerendered app deployed at the given URL for your app:
