For past Angular 2 projects, I would upload the static dist folder from Angular CLI build to Google Cloud Platform. I would use the SDK with command gcloud app deploy app.yaml
with this app.yaml file:
application:
version:
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /(.*\.(gif|png|jpeg|jpg|css|js)(|\.map))$
static_files: dist/\1
upload: dist/(.*)(|\.map)
- url: /(.*)
static_files: dist/index.html
upload: dist/index.html
I have started using the Universal-CLI. It too produces a dist folder with the ung build
command.
The documentation outlines two approaches for server rendering. Is this dist folder what they mean by the first approach:
The first option is to pre-render your application which means that you would use one of the Universal build tools (i.e. gulp, grunt, broccoli, webpack, etc.) to generate static HTML for all your routes at build time. Then you could deploy that static HTML to a CDN.
Is Angular Universal working as intended if I deploy dist folder in the same way as I was doing for past angular 2 projects outlined above?
If not how should an Angular Universal project be deployed?