Hi welkome to the code of bankular. Here you find an exampke bank where we have been using angular with universal for server side rendering.
We are using at this time of writing Angular CLI version 7.3.1.
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.
the only thing is at this moment the backend is not stubbed. we are using fiddler to do this. and proxy trough all calls to our ssr server that can be started with npm start
this will compile your code to a ssr version. en will be started with the backend server.
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
.
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.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To deploy the code on AWS we where using an elastic beanstalk. You have to create 2 environment variables.
- PORT = 8008
- DIST = /browser
you can run the command npm run build:ssrAWS
to generate a zipped version of the application and you can basically upload this to your AWS elastic beanstalk. but before running that command you want to put the URL of your environment in environments\environment.prod.ts
you can see en example commented out there. For the client version this is not needed. because the browser knows the host. somthing you dont know server side.
you can find the client side version in this branch here