├── .gitignore ├── ng-client ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── weather-forecast-list │ │ │ ├── weather-forecast-list.component.scss │ │ │ ├── weather-forecast-list.component.html │ │ │ ├── weather-forecast-list.component.ts │ │ │ └── weather-forecast-list.component.spec.ts │ │ ├── tokens.ts │ │ ├── app.component.ts │ │ ├── app.server.module.ts │ │ ├── services │ │ │ ├── weather-forecast.service.spec.ts │ │ │ └── weather-forecast.service.ts │ │ ├── weather-forecast.resolver.spec.ts │ │ ├── weather-forecast.resolver.ts │ │ ├── app.component.html │ │ ├── app-routing.module.ts │ │ ├── app.module.ts │ │ ├── app.component.scss │ │ └── app.component.spec.ts │ ├── styles.scss │ ├── favicon.ico │ ├── models │ │ └── weather-forecast.ts │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── main.server.ts │ ├── index.html │ ├── main.ts │ ├── test.ts │ └── polyfills.ts ├── .vscode │ └── settings.json ├── e2e │ ├── src │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ ├── tsconfig.json │ └── protractor.conf.js ├── .editorconfig ├── tsconfig.app.json ├── tsconfig.spec.json ├── tsconfig.server.json ├── .browserslistrc ├── tsconfig.json ├── .gitignore ├── README.md ├── .eslintrc.json ├── karma.conf.js ├── package.json ├── web.config ├── server.ts └── angular.json ├── WebAPI ├── global.json ├── appsettings.Development.json ├── appsettings.json ├── Models │ └── WeatherForecast.cs ├── WebAPI.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── WebAPI.sln ├── Controllers │ └── WeatherForecastController.cs ├── Startup.cs └── .gitignore ├── README.md └── .github └── workflows └── azure.yml /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ -------------------------------------------------------------------------------- /ng-client/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WebAPI/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "5.0.200" 4 | } 5 | } -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast-list/weather-forecast-list.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ng-client/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib" 3 | } -------------------------------------------------------------------------------- /ng-client/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ng-client/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mopinsk/aspnetcore-angular-ssr/HEAD/ng-client/src/favicon.ico -------------------------------------------------------------------------------- /ng-client/src/app/tokens.ts: -------------------------------------------------------------------------------- 1 | import { InjectionToken } from '@angular/core'; 2 | 3 | export const BASE_API_URL = new InjectionToken('BASE_API_URL'); 4 | -------------------------------------------------------------------------------- /ng-client/src/models/weather-forecast.ts: -------------------------------------------------------------------------------- 1 | export interface WeatherForecast { 2 | date: string; 3 | temperatureC: number; 4 | temperatureF: number; 5 | summary: string; 6 | } 7 | -------------------------------------------------------------------------------- /ng-client/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | baseUrl: 'https://aspnetcore-angular-ssr.azurewebsites.net/webapi', // put your own app service / Web API URL here 4 | }; 5 | -------------------------------------------------------------------------------- /WebAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WebAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /WebAPI/Models/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPI.Models 4 | { 5 | public record WeatherForecast(DateTime Date, int TemperatureC, string Summary) 6 | { 7 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ng-client/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'ng-client'; 10 | } 11 | -------------------------------------------------------------------------------- /ng-client/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ng-client/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ng-client/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /ng-client/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | 3 | import { environment } from './environments/environment'; 4 | 5 | if (environment.production) { 6 | enableProdMode(); 7 | } 8 | 9 | export { AppServerModule } from './app/app.server.module'; 10 | export { renderModule, renderModuleFactory } from '@angular/platform-server'; 11 | -------------------------------------------------------------------------------- /ng-client/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NgClient 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ng-client/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast-list/weather-forecast-list.component.html: -------------------------------------------------------------------------------- 1 |

Weather Forecasts

2 | 3 |
    4 |
  • 5 | {{ forecast.date | date }}: {{ forecast.temperatureC }}°C / {{ forecast.temperatureF }}°F - {{ forecast.summary}} 6 |
  • 7 |
8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /WebAPI/WebAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | enable 6 | 9.0 7 | 8 | 9 | 10 | 11 | Never 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ng-client/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ng-client/src/app/app.server.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { 3 | ServerModule, 4 | ServerTransferStateModule, 5 | } from '@angular/platform-server'; 6 | 7 | import { AppModule } from './app.module'; 8 | import { AppComponent } from './app.component'; 9 | 10 | @NgModule({ 11 | imports: [AppModule, ServerModule, ServerTransferStateModule], 12 | bootstrap: [AppComponent], 13 | }) 14 | export class AppServerModule {} 15 | -------------------------------------------------------------------------------- /ng-client/tsconfig.server.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.app.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/server", 6 | "target": "es2016", 7 | "types": [ 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "src/main.server.ts", 13 | "server.ts" 14 | ], 15 | "angularCompilerOptions": { 16 | "entryModule": "./src/app/app.server.module#AppServerModule" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ng-client/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | document.addEventListener('DOMContentLoaded', () => { 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | }); 15 | -------------------------------------------------------------------------------- /ng-client/src/app/services/weather-forecast.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { WeatherForecastService } from './weather-forecast.service'; 4 | 5 | describe('WeatherForecastService', () => { 6 | let service: WeatherForecastService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(WeatherForecastService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast.resolver.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { WeatherForecastResolver } from './weather-forecast.resolver'; 4 | 5 | describe('WeatherForecastResolver', () => { 6 | let resolver: WeatherForecastResolver; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | resolver = TestBed.inject(WeatherForecastResolver); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(resolver).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast.resolver.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Resolve } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { WeatherForecast } from 'src/models/weather-forecast'; 5 | import { WeatherForecastService } from 'src/app/services/weather-forecast.service'; 6 | 7 | @Injectable({ 8 | providedIn: 'root', 9 | }) 10 | export class WeatherForecastResolver implements Resolve { 11 | constructor(private weatherForecastService: WeatherForecastService) {} 12 | 13 | resolve(): Observable { 14 | return this.weatherForecastService.getForecasts(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ng-client/src/app/services/weather-forecast.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Inject } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { BASE_API_URL } from 'src/app/tokens'; 4 | import { Observable } from 'rxjs'; 5 | import { WeatherForecast } from 'src/models/weather-forecast'; 6 | 7 | @Injectable({ 8 | providedIn: 'root', 9 | }) 10 | export class WeatherForecastService { 11 | constructor( 12 | private http: HttpClient, 13 | @Inject(BASE_API_URL) private baseUrl: string 14 | ) {} 15 | 16 | getForecasts(): Observable { 17 | return this.http.get(`${this.baseUrl}/WeatherForecast`); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ng-client/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 |
10 | -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast-list/weather-forecast-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | import { map } from 'rxjs/operators'; 5 | import { WeatherForecast } from 'src/models/weather-forecast'; 6 | 7 | @Component({ 8 | selector: 'app-weather-forecast-list', 9 | templateUrl: './weather-forecast-list.component.html', 10 | styleUrls: ['./weather-forecast-list.component.scss'], 11 | }) 12 | export class WeatherForecastListComponent { 13 | public forecasts$: Observable< 14 | WeatherForecast[] 15 | > = this.activatedRoute.data.pipe(map((data) => data.forecasts)); 16 | 17 | constructor(private activatedRoute: ActivatedRoute) {} 18 | } 19 | -------------------------------------------------------------------------------- /ng-client/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { browser, logging } from 'protractor'; 2 | import { AppPage } from './app.po'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', async () => { 12 | await page.navigateTo(); 13 | expect(await page.getTitleText()).toEqual('ng-client app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /ng-client/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { WeatherForecastListComponent } from './weather-forecast-list/weather-forecast-list.component'; 4 | import { WeatherForecastResolver } from './weather-forecast.resolver'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | component: WeatherForecastListComponent, 10 | resolve: { forecasts: WeatherForecastResolver }, 11 | }, 12 | { 13 | path: '**', 14 | redirectTo: '', 15 | }, 16 | ]; 17 | 18 | @NgModule({ 19 | imports: [ 20 | RouterModule.forRoot(routes, { 21 | initialNavigation: 'enabled', 22 | }), 23 | ], 24 | exports: [RouterModule], 25 | }) 26 | export class AppRoutingModule {} 27 | -------------------------------------------------------------------------------- /ng-client/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 18 | -------------------------------------------------------------------------------- /ng-client/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | baseUrl: 'http://localhost:4053', 8 | }; 9 | 10 | /* 11 | * For easier debugging in development mode, you can import the following file 12 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 13 | * 14 | * This import should be commented out in production mode because it will have a negative impact 15 | * on performance if an error is thrown. 16 | */ 17 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 18 | -------------------------------------------------------------------------------- /WebAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPI 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ng-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "noImplicitReturns": true, 9 | "noFallthroughCasesInSwitch": true, 10 | "sourceMap": true, 11 | "declaration": false, 12 | "downlevelIteration": true, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "importHelpers": true, 16 | "target": "es2015", 17 | "module": "es2020", 18 | "lib": ["es2018", "dom"] 19 | }, 20 | "angularCompilerOptions": { 21 | "enableI18nLegacyMessageIdFormat": false, 22 | "strictInjectionParameters": true, 23 | "strictInputAccessModifiers": true, 24 | "strictTemplates": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ng-client/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /WebAPI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:4053", 7 | "sslPort": 44398 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchUrl": "swagger", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "WebAPI": { 20 | "commandName": "Project", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "dotnetRunMessages": "true", 25 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /ng-client/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /ng-client/src/app/weather-forecast-list/weather-forecast-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WeatherForecastListComponent } from './weather-forecast-list.component'; 4 | 5 | describe('WeatherForecastListComponent', () => { 6 | let component: WeatherForecastListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ WeatherForecastListComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WeatherForecastListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /ng-client/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { HttpClientModule } from '@angular/common/http'; 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | import { TransferHttpCacheModule } from '@nguniversal/common'; 5 | import { environment } from 'src/environments/environment'; 6 | import { AppRoutingModule } from './app-routing.module'; 7 | import { AppComponent } from './app.component'; 8 | import { BASE_API_URL } from './tokens'; 9 | import { WeatherForecastListComponent } from './weather-forecast-list/weather-forecast-list.component'; 10 | 11 | @NgModule({ 12 | declarations: [AppComponent, WeatherForecastListComponent], 13 | imports: [ 14 | BrowserModule.withServerTransition({ appId: 'serverApp' }), 15 | HttpClientModule, 16 | TransferHttpCacheModule, 17 | AppRoutingModule, 18 | ], 19 | providers: [ 20 | { 21 | provide: BASE_API_URL, 22 | useValue: environment.baseUrl, 23 | }, 24 | ], 25 | bootstrap: [AppComponent], 26 | }) 27 | export class AppModule {} 28 | -------------------------------------------------------------------------------- /ng-client/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; -------------------------------------------------------------------------------- /ng-client/README.md: -------------------------------------------------------------------------------- 1 | # NgClient 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.3. 4 | 5 | ## Development server 6 | 7 | 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. 8 | 9 | ## Code scaffolding 10 | 11 | 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`. 12 | 13 | ## Build 14 | 15 | 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. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /ng-client/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, 3 | Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 4 | font-size: 14px; 5 | color: #333; 6 | box-sizing: border-box; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | h1, 12 | h2, 13 | h3, 14 | h4, 15 | h5, 16 | h6 { 17 | margin: 8px 0; 18 | } 19 | 20 | p { 21 | margin: 0; 22 | } 23 | 24 | .spacer { 25 | flex: 1; 26 | } 27 | 28 | .toolbar { 29 | position: absolute; 30 | top: 0; 31 | left: 0; 32 | right: 0; 33 | height: 60px; 34 | display: flex; 35 | align-items: center; 36 | background-color: #1976d2; 37 | color: white; 38 | font-weight: 600; 39 | } 40 | 41 | .toolbar img { 42 | margin: 0 16px; 43 | } 44 | 45 | .content { 46 | display: flex; 47 | margin: 82px auto 32px; 48 | padding: 0 16px; 49 | max-width: 960px; 50 | flex-direction: column; 51 | align-items: center; 52 | } 53 | 54 | a, 55 | a:visited, 56 | a:hover { 57 | color: #1976d2; 58 | text-decoration: none; 59 | } 60 | 61 | a:hover { 62 | color: #125699; 63 | } 64 | -------------------------------------------------------------------------------- /WebAPI/WebAPI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31025.194 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAPI", "WebAPI.csproj", "{A023E628-DE40-4BB5-B56E-0C3C76DF734B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A023E628-DE40-4BB5-B56E-0C3C76DF734B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A023E628-DE40-4BB5-B56E-0C3C76DF734B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A023E628-DE40-4BB5-B56E-0C3C76DF734B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A023E628-DE40-4BB5-B56E-0C3C76DF734B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {7BC18C7B-FE98-429B-A078-7AC96F446E63} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ng-client/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'ng-client'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('ng-client'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement; 33 | expect(compiled.querySelector('.content span').textContent).toContain('ng-client app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /ng-client/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": [ 4 | "projects/**/*" 5 | ], 6 | "overrides": [ 7 | { 8 | "files": [ 9 | "*.ts" 10 | ], 11 | "parserOptions": { 12 | "project": [ 13 | "tsconfig.json", 14 | "e2e/tsconfig.json" 15 | ], 16 | "createDefaultProgram": true 17 | }, 18 | "extends": [ 19 | "plugin:@angular-eslint/recommended", 20 | "plugin:@angular-eslint/template/process-inline-templates" 21 | ], 22 | "rules": { 23 | "@angular-eslint/directive-selector": [ 24 | "error", 25 | { 26 | "type": "attribute", 27 | "prefix": "app", 28 | "style": "camelCase" 29 | } 30 | ], 31 | "@angular-eslint/component-selector": [ 32 | "error", 33 | { 34 | "type": "element", 35 | "prefix": "app", 36 | "style": "kebab-case" 37 | } 38 | ] 39 | } 40 | }, 41 | { 42 | "files": [ 43 | "*.html" 44 | ], 45 | "extends": [ 46 | "plugin:@angular-eslint/template/recommended" 47 | ], 48 | "rules": {} 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /WebAPI/Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Logging; 7 | using WebAPI.Models; 8 | 9 | namespace WebAPI.Controllers 10 | { 11 | [ApiController] 12 | [Route("[controller]")] 13 | public class WeatherForecastController : ControllerBase 14 | { 15 | private static readonly string[] Summaries = new[] 16 | { 17 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 18 | }; 19 | 20 | private readonly ILogger _logger; 21 | 22 | public WeatherForecastController(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | [HttpGet] 28 | public IEnumerable Get() 29 | { 30 | var rng = new Random(); 31 | var forecasts = Enumerable.Range(1, 5) 32 | .Select(index => new WeatherForecast(DateTime.Now.AddDays(index), rng.Next(-20, 55), Summaries[rng.Next(Summaries.Length)])) 33 | .ToArray(); 34 | 35 | _logger.LogDebug("Created forecasts {Forecasts}", forecasts); 36 | 37 | return forecasts; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ng-client/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/ng-client'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /WebAPI/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Hosting; 10 | 11 | namespace WebAPI 12 | { 13 | public class Startup 14 | { 15 | private readonly string corsPolicyName = "myCorsPolicy"; 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services.AddCors(options => 27 | options.AddPolicy(this.corsPolicyName, builder => 28 | builder.AllowAnyOrigin() 29 | .AllowAnyMethod() 30 | .AllowAnyHeader())); 31 | services.AddControllers(); 32 | } 33 | 34 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 35 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 36 | { 37 | if (env.IsDevelopment()) 38 | { 39 | app.UseDeveloperExceptionPage(); 40 | } 41 | 42 | // app.UseHttpsRedirection(); 43 | 44 | app.UseRouting(); 45 | 46 | app.UseCors(this.corsPolicyName); 47 | 48 | app.UseAuthorization(); 49 | 50 | app.UseEndpoints(endpoints => 51 | { 52 | endpoints.MapControllers(); 53 | }); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ng-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-client", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e", 11 | "dev:ssr": "ng run ng-client:serve-ssr", 12 | "serve:ssr": "node dist/ng-client/server/main.js", 13 | "build:ssr": "ng build --prod && ng run ng-client:server:production", 14 | "prerender": "ng run ng-client:prerender" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular/animations": "~11.2.4", 19 | "@angular/common": "~11.2.4", 20 | "@angular/compiler": "~11.2.4", 21 | "@angular/core": "~11.2.4", 22 | "@angular/forms": "~11.2.4", 23 | "@angular/platform-browser": "~11.2.4", 24 | "@angular/platform-browser-dynamic": "~11.2.4", 25 | "@angular/platform-server": "~11.2.4", 26 | "@angular/router": "~11.2.4", 27 | "@nguniversal/express-engine": "^11.2.1", 28 | "express": "^4.15.2", 29 | "rxjs": "~6.6.0", 30 | "tslib": "^2.0.0", 31 | "zone.js": "~0.11.3" 32 | }, 33 | "devDependencies": { 34 | "@angular-devkit/build-angular": "~0.1102.3", 35 | "@angular-eslint/builder": "1.2.0", 36 | "@angular-eslint/eslint-plugin": "1.2.0", 37 | "@angular-eslint/eslint-plugin-template": "1.2.0", 38 | "@angular-eslint/schematics": "1.2.0", 39 | "@angular-eslint/template-parser": "1.2.0", 40 | "@angular/cli": "~11.2.3", 41 | "@angular/compiler-cli": "~11.2.4", 42 | "@nguniversal/builders": "^11.2.1", 43 | "@types/express": "^4.17.0", 44 | "@types/jasmine": "~3.6.0", 45 | "@types/node": "^12.11.1", 46 | "@typescript-eslint/eslint-plugin": "4.3.0", 47 | "@typescript-eslint/parser": "4.3.0", 48 | "eslint": "^7.6.0", 49 | "eslint-plugin-import": "2.22.1", 50 | "eslint-plugin-jsdoc": "30.7.6", 51 | "eslint-plugin-prefer-arrow": "1.2.2", 52 | "jasmine-core": "~3.6.0", 53 | "jasmine-spec-reporter": "~5.0.0", 54 | "karma": "~6.1.0", 55 | "karma-chrome-launcher": "~3.1.0", 56 | "karma-coverage": "~2.0.3", 57 | "karma-jasmine": "~4.0.0", 58 | "karma-jasmine-html-reporter": "^1.5.0", 59 | "protractor": "~7.0.0", 60 | "ts-node": "~8.3.0", 61 | "typescript": "~4.1.5" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ng-client/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ng-client/server.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js/dist/zone-node'; 2 | 3 | import { ngExpressEngine } from '@nguniversal/express-engine'; 4 | import * as express from 'express'; 5 | import { join } from 'path'; 6 | 7 | import { AppServerModule } from './src/main.server'; 8 | import { APP_BASE_HREF } from '@angular/common'; 9 | import { existsSync } from 'fs'; 10 | 11 | // The Express app is exported so that it can be used by serverless Functions. 12 | export function app(): express.Express { 13 | const server = express(); 14 | let distFolder = join(process.cwd(), 'browser'); 15 | if (!existsSync(distFolder)) { 16 | distFolder = join(process.cwd(), 'dist/ng-client/browser'); 17 | } 18 | 19 | const indexHtml = existsSync(join(distFolder, 'index.original.html')) 20 | ? 'index.original.html' 21 | : 'index'; 22 | 23 | // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine) 24 | server.engine( 25 | 'html', 26 | ngExpressEngine({ 27 | bootstrap: AppServerModule, 28 | }) 29 | ); 30 | 31 | server.set('view engine', 'html'); 32 | server.set('views', distFolder); 33 | 34 | // Example Express Rest API endpoints 35 | // server.get('/api/**', (req, res) => { }); 36 | // Serve static files from /browser 37 | server.get( 38 | '*.*', 39 | express.static(distFolder, { 40 | maxAge: '1y', 41 | }) 42 | ); 43 | 44 | // All regular routes use the Universal engine 45 | server.get('*', (req, res) => { 46 | res.render(indexHtml, { 47 | req, 48 | providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }], 49 | }); 50 | }); 51 | 52 | return server; 53 | } 54 | 55 | function run(): void { 56 | const port = process.env.PORT || 4000; 57 | 58 | // Start up the Node server 59 | const server = app(); 60 | server.listen(port, () => { 61 | console.log(`Node Express server listening on http://localhost:${port}`); 62 | }); 63 | } 64 | 65 | // Webpack will replace 'require' with '__webpack_require__' 66 | // '__non_webpack_require__' is a proxy to Node 'require' 67 | // The below code is to ensure that the server is run only when not requiring the bundle. 68 | declare const __non_webpack_require__: NodeRequire; 69 | const mainModule = __non_webpack_require__.main; 70 | const moduleFilename = (mainModule && mainModule.filename) || ''; 71 | if (moduleFilename === __filename || moduleFilename.includes('iisnode')) { 72 | run(); 73 | } 74 | 75 | export * from './src/main.server'; 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aspnetcore-angular-ssr 2 | 3 | A simple ASP.NET Core Web API and Angular Client with server-side rendering. 4 | 5 | - The default Angular route displays the _WeatherForecastListComponent_. 6 | - This route gets its data via the _WeatherForecastResolver_. 7 | - The resolver uses the _WeatherForecastService_ which makes the HTTP request to the Web API 8 | 9 | # Angular Client 10 | 11 | Install Angular CLI and Angular-ESLint schematics globally 12 | 13 | ``` 14 | npm i -g @angular/cli @angular-devkit/core @angular-devkit/schematics @angular-eslint/schematics 15 | ``` 16 | 17 | Initialize an Angular app: 18 | 19 | ``` 20 | ng new ng-client --directory=ng-client --routing --skip-git --strict --style=scss --package-manager=npm --collection=@angular-eslint/schematics 21 | ``` 22 | 23 | Follow the instructions described in the official Angular Universal docs: https://angular.io/guide/universal 24 | 25 | ``` 26 | ng add @nguniversal/express-engine 27 | ``` 28 | 29 | Follow these instructions: 30 | 31 | Update server.ts for Production (instructions taken from https://bossprogrammer.medium.com/how-to-deploy-an-angular-10-universal-app-with-server-side-rendering-to-azure-a2b90df9ca64 ) 32 | 33 | Replace this line in server.ts: 34 | 35 | ```ts 36 | const distFolder = join(process.cwd(), 'dist/YOUR_APP_NAME/browser'); 37 | ``` 38 | 39 | With: 40 | 41 | ```ts 42 | let distFolder = join(process.cwd(), 'browser'); 43 | if (!existsSync(distFolder)) { 44 | distFolder = join(process.cwd(), 'dist/YOUR_APP_NAME/browser'); 45 | } 46 | ``` 47 | 48 | # ASP.NET Core Web API 49 | 50 | ``` 51 | dotnet new webapi -n WebAPI -o WebAPI -f net5.0 52 | ``` 53 | 54 | The Web API runs on IIS Express when started in Visual Studio 2019: (as stated in launchSettings.json) 55 | 56 | - http://localhost:4053 57 | - https://localhost:44398 58 | 59 | The Angular app uses the value from environment.ts as the base URL for HTTP requests. 60 | 61 | HTTPS redirection is disabled in ASP.NET Core, otherwise HTTP requests in SSR development mode will fail. 62 | 63 | # Azure 64 | 65 | Create an Azure App Service (Web App) with Stack ".NET 5" 66 | 67 | Go To _TLS/SSL Settings_ and enable "HTTPS Only" 68 | 69 | Go to _Configuration_ and add this _application setting_: 70 | 71 | - Key: WEBSITE_NODE_DEFAULT_VERSION 72 | - Value: ~12 73 | 74 | Add/Edit Path Mappings: 75 | 76 | | Virtual Path | Physical Path | Type | 77 | | ------------ | ---------------------- | ----------- | 78 | | / | site\wwwroot\ng-client | Application | 79 | | /webapi | site\wwwroot\webapi | Application | 80 | -------------------------------------------------------------------------------- /ng-client/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** 22 | * IE11 requires the following for NgClass support on SVG elements 23 | */ 24 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 25 | 26 | /** 27 | * Web Animations `@angular/platform-browser/animations` 28 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 29 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 30 | */ 31 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 32 | 33 | /** 34 | * By default, zone.js will patch all possible macroTask and DomEvents 35 | * user can disable parts of macroTask/DomEvents patch by setting following flags 36 | * because those flags need to be set before `zone.js` being loaded, and webpack 37 | * will put import in the top of bundle, so user need to create a separate file 38 | * in this directory (for example: zone-flags.ts), and put the following flags 39 | * into that file, and then add the following code before importing zone.js. 40 | * import './zone-flags'; 41 | * 42 | * The flags allowed in zone-flags.ts are listed here. 43 | * 44 | * The following flags will work for all browsers. 45 | * 46 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 47 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 48 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 49 | * 50 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 51 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 52 | * 53 | * (window as any).__Zone_enable_cross_context_check = true; 54 | * 55 | */ 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | /*************************************************************************************************** 64 | * APPLICATION IMPORTS 65 | */ 66 | -------------------------------------------------------------------------------- /.github/workflows/azure.yml: -------------------------------------------------------------------------------- 1 | name: Build and deploy 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | env: 10 | AZURE_WEBAPP_NAME: aspnetcore-angular-ssr # set this to your application's name 11 | AZURE_WEBAPP_PACKAGE_PATH: './dist' # set this to the path to your web app project, defaults to the repository root 12 | NODE_VERSION: '12.x' # set this to the node version to use 13 | DOTNET_VERSION: '5.0.x' 14 | WEB_API_PROJECT: './WebAPI/WebAPI.csproj' 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Setup .NET 23 | uses: actions/setup-dotnet@v1 24 | with: 25 | dotnet-version: ${{ env.DOTNET_VERSION }} 26 | - name: Restore dependencies 27 | run: dotnet restore ${{ env.WEB_API_PROJECT }} 28 | - name: Build Web API 29 | run: dotnet build ${{ env.WEB_API_PROJECT }} --no-restore -c Release 30 | - name: Publish Web API 31 | run: dotnet publish ${{ env.WEB_API_PROJECT }} --no-build --verbosity normal -c Release -o "./dist/webapi" 32 | - name: Use Node.js ${{ env.NODE_VERSION }} 33 | uses: actions/setup-node@v1 34 | with: 35 | node-version: ${{ env.NODE_VERSION }} 36 | - name: Restore npm packages 37 | run: npm install 38 | working-directory: ./ng-client 39 | - name: Build Angular App 40 | run: npm run build:ssr 41 | working-directory: ./ng-client 42 | - name: Create directory for Angular files 43 | run: mkdir -p ./dist/ng-client 44 | - name: Copy Angular files 45 | run: cp -r ./ng-client/dist/ng-client/browser ./dist/ng-client/browser 46 | - name: Copy server/main.js 47 | run: cp ./ng-client/dist/ng-client/server/main.js ./dist/ng-client/main.js 48 | - name: Copy Angular client web.config 49 | run: cp ./ng-client/web.config ./dist/ng-client/web.config 50 | - name: Upload a Build Artifact 51 | uses: actions/upload-artifact@v2.2.2 52 | with: 53 | name: WebAPI_and_Client 54 | path: './dist' 55 | if-no-files-found: error 56 | 57 | # This workflow will build and push a node.js application to an Azure Web App when a release is created. 58 | # 59 | # This workflow assumes you have already created the target Azure App Service web app. 60 | # For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan 61 | # 62 | # To configure this workflow: 63 | # 64 | # 1. For Linux apps, add an app setting called WEBSITE_WEBDEPLOY_USE_SCM and set it to true in your app **before downloading the file**. 65 | # For more instructions see: https://docs.microsoft.com/azure/app-service/configure-common#configure-app-settings 66 | # 67 | # 2. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile. 68 | # For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret 69 | # 70 | # 3. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). 71 | # 72 | # For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions 73 | # For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples 74 | - name: Azure WebApp 75 | uses: Azure/webapps-deploy@v2 76 | with: 77 | app-name: ${{ env.AZURE_WEBAPP_NAME }} 78 | publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} 79 | package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} 80 | -------------------------------------------------------------------------------- /ng-client/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "cli": { 5 | "packageManager": "npm", 6 | "defaultCollection": "@angular-eslint/schematics" 7 | }, 8 | "newProjectRoot": "projects", 9 | "projects": { 10 | "ng-client": { 11 | "projectType": "application", 12 | "schematics": { 13 | "@schematics/angular:component": { 14 | "style": "scss" 15 | }, 16 | "@schematics/angular:application": { 17 | "strict": true 18 | } 19 | }, 20 | "root": "", 21 | "sourceRoot": "src", 22 | "prefix": "app", 23 | "architect": { 24 | "build": { 25 | "builder": "@angular-devkit/build-angular:browser", 26 | "options": { 27 | "outputPath": "dist/ng-client/browser", 28 | "index": "src/index.html", 29 | "main": "src/main.ts", 30 | "polyfills": "src/polyfills.ts", 31 | "tsConfig": "tsconfig.app.json", 32 | "aot": true, 33 | "assets": [ 34 | "src/favicon.ico", 35 | "src/assets" 36 | ], 37 | "styles": [ 38 | "src/styles.scss" 39 | ], 40 | "scripts": [] 41 | }, 42 | "configurations": { 43 | "production": { 44 | "fileReplacements": [ 45 | { 46 | "replace": "src/environments/environment.ts", 47 | "with": "src/environments/environment.prod.ts" 48 | } 49 | ], 50 | "optimization": true, 51 | "outputHashing": "all", 52 | "sourceMap": false, 53 | "namedChunks": false, 54 | "extractLicenses": true, 55 | "vendorChunk": false, 56 | "buildOptimizer": true, 57 | "budgets": [ 58 | { 59 | "type": "initial", 60 | "maximumWarning": "500kb", 61 | "maximumError": "1mb" 62 | }, 63 | { 64 | "type": "anyComponentStyle", 65 | "maximumWarning": "2kb", 66 | "maximumError": "4kb" 67 | } 68 | ] 69 | } 70 | } 71 | }, 72 | "serve": { 73 | "builder": "@angular-devkit/build-angular:dev-server", 74 | "options": { 75 | "browserTarget": "ng-client:build" 76 | }, 77 | "configurations": { 78 | "production": { 79 | "browserTarget": "ng-client:build:production" 80 | } 81 | } 82 | }, 83 | "extract-i18n": { 84 | "builder": "@angular-devkit/build-angular:extract-i18n", 85 | "options": { 86 | "browserTarget": "ng-client:build" 87 | } 88 | }, 89 | "test": { 90 | "builder": "@angular-devkit/build-angular:karma", 91 | "options": { 92 | "main": "src/test.ts", 93 | "polyfills": "src/polyfills.ts", 94 | "tsConfig": "tsconfig.spec.json", 95 | "karmaConfig": "karma.conf.js", 96 | "assets": [ 97 | "src/favicon.ico", 98 | "src/assets" 99 | ], 100 | "styles": [ 101 | "src/styles.scss" 102 | ], 103 | "scripts": [] 104 | } 105 | }, 106 | "lint": { 107 | "builder": "@angular-eslint/builder:lint", 108 | "options": { 109 | "lintFilePatterns": [ 110 | "src/**/*.ts", 111 | "src/**/*.html" 112 | ] 113 | } 114 | }, 115 | "e2e": { 116 | "builder": "@angular-devkit/build-angular:protractor", 117 | "options": { 118 | "protractorConfig": "e2e/protractor.conf.js", 119 | "devServerTarget": "ng-client:serve" 120 | }, 121 | "configurations": { 122 | "production": { 123 | "devServerTarget": "ng-client:serve:production" 124 | } 125 | } 126 | }, 127 | "server": { 128 | "builder": "@angular-devkit/build-angular:server", 129 | "options": { 130 | "outputPath": "dist/ng-client/server", 131 | "main": "server.ts", 132 | "tsConfig": "tsconfig.server.json" 133 | }, 134 | "configurations": { 135 | "production": { 136 | "outputHashing": "media", 137 | "fileReplacements": [ 138 | { 139 | "replace": "src/environments/environment.ts", 140 | "with": "src/environments/environment.prod.ts" 141 | } 142 | ], 143 | "sourceMap": false, 144 | "optimization": true 145 | } 146 | } 147 | }, 148 | "serve-ssr": { 149 | "builder": "@nguniversal/builders:ssr-dev-server", 150 | "options": { 151 | "browserTarget": "ng-client:build", 152 | "serverTarget": "ng-client:server" 153 | }, 154 | "configurations": { 155 | "production": { 156 | "browserTarget": "ng-client:build:production", 157 | "serverTarget": "ng-client:server:production" 158 | } 159 | } 160 | }, 161 | "prerender": { 162 | "builder": "@nguniversal/builders:prerender", 163 | "options": { 164 | "browserTarget": "ng-client:build:production", 165 | "serverTarget": "ng-client:server:production", 166 | "routes": [ 167 | "/" 168 | ] 169 | }, 170 | "configurations": { 171 | "production": {} 172 | } 173 | } 174 | } 175 | } 176 | }, 177 | "defaultProject": "ng-client" 178 | } 179 | -------------------------------------------------------------------------------- /WebAPI/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # Tye 65 | .tye/ 66 | 67 | # StyleCop 68 | StyleCopReport.xml 69 | 70 | # Files built by Visual Studio 71 | *_i.c 72 | *_p.c 73 | *_h.h 74 | *.ilk 75 | *.meta 76 | *.obj 77 | *.iobj 78 | *.pch 79 | *.pdb 80 | *.ipdb 81 | *.pgc 82 | *.pgd 83 | *.rsp 84 | *.sbr 85 | *.tlb 86 | *.tli 87 | *.tlh 88 | *.tmp 89 | *.tmp_proj 90 | *_wpftmp.csproj 91 | *.log 92 | *.vspscc 93 | *.vssscc 94 | .builds 95 | *.pidb 96 | *.svclog 97 | *.scc 98 | 99 | # Chutzpah Test files 100 | _Chutzpah* 101 | 102 | # Visual C++ cache files 103 | ipch/ 104 | *.aps 105 | *.ncb 106 | *.opendb 107 | *.opensdf 108 | *.sdf 109 | *.cachefile 110 | *.VC.db 111 | *.VC.VC.opendb 112 | 113 | # Visual Studio profiler 114 | *.psess 115 | *.vsp 116 | *.vspx 117 | *.sap 118 | 119 | # Visual Studio Trace Files 120 | *.e2e 121 | 122 | # TFS 2012 Local Workspace 123 | $tf/ 124 | 125 | # Guidance Automation Toolkit 126 | *.gpState 127 | 128 | # ReSharper is a .NET coding add-in 129 | _ReSharper*/ 130 | *.[Rr]e[Ss]harper 131 | *.DotSettings.user 132 | 133 | # TeamCity is a build add-in 134 | _TeamCity* 135 | 136 | # DotCover is a Code Coverage Tool 137 | *.dotCover 138 | 139 | # AxoCover is a Code Coverage Tool 140 | .axoCover/* 141 | !.axoCover/settings.json 142 | 143 | # Coverlet is a free, cross platform Code Coverage Tool 144 | coverage*[.json, .xml, .info] 145 | 146 | # Visual Studio code coverage results 147 | *.coverage 148 | *.coveragexml 149 | 150 | # NCrunch 151 | _NCrunch_* 152 | .*crunch*.local.xml 153 | nCrunchTemp_* 154 | 155 | # MightyMoose 156 | *.mm.* 157 | AutoTest.Net/ 158 | 159 | # Web workbench (sass) 160 | .sass-cache/ 161 | 162 | # Installshield output folder 163 | [Ee]xpress/ 164 | 165 | # DocProject is a documentation generator add-in 166 | DocProject/buildhelp/ 167 | DocProject/Help/*.HxT 168 | DocProject/Help/*.HxC 169 | DocProject/Help/*.hhc 170 | DocProject/Help/*.hhk 171 | DocProject/Help/*.hhp 172 | DocProject/Help/Html2 173 | DocProject/Help/html 174 | 175 | # Click-Once directory 176 | publish/ 177 | 178 | # Publish Web Output 179 | *.[Pp]ublish.xml 180 | *.azurePubxml 181 | # Note: Comment the next line if you want to checkin your web deploy settings, 182 | # but database connection strings (with potential passwords) will be unencrypted 183 | *.pubxml 184 | *.publishproj 185 | 186 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 187 | # checkin your Azure Web App publish settings, but sensitive information contained 188 | # in these scripts will be unencrypted 189 | PublishScripts/ 190 | 191 | # NuGet Packages 192 | *.nupkg 193 | # NuGet Symbol Packages 194 | *.snupkg 195 | # The packages folder can be ignored because of Package Restore 196 | **/[Pp]ackages/* 197 | # except build/, which is used as an MSBuild target. 198 | !**/[Pp]ackages/build/ 199 | # Uncomment if necessary however generally it will be regenerated when needed 200 | #!**/[Pp]ackages/repositories.config 201 | # NuGet v3's project.json files produces more ignorable files 202 | *.nuget.props 203 | *.nuget.targets 204 | 205 | # Microsoft Azure Build Output 206 | csx/ 207 | *.build.csdef 208 | 209 | # Microsoft Azure Emulator 210 | ecf/ 211 | rcf/ 212 | 213 | # Windows Store app package directories and files 214 | AppPackages/ 215 | BundleArtifacts/ 216 | Package.StoreAssociation.xml 217 | _pkginfo.txt 218 | *.appx 219 | *.appxbundle 220 | *.appxupload 221 | 222 | # Visual Studio cache files 223 | # files ending in .cache can be ignored 224 | *.[Cc]ache 225 | # but keep track of directories ending in .cache 226 | !?*.[Cc]ache/ 227 | 228 | # Others 229 | ClientBin/ 230 | ~$* 231 | *~ 232 | *.dbmdl 233 | *.dbproj.schemaview 234 | *.jfm 235 | *.pfx 236 | *.publishsettings 237 | orleans.codegen.cs 238 | 239 | # Including strong name files can present a security risk 240 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 241 | #*.snk 242 | 243 | # Since there are multiple workflows, uncomment next line to ignore bower_components 244 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 245 | #bower_components/ 246 | 247 | # RIA/Silverlight projects 248 | Generated_Code/ 249 | 250 | # Backup & report files from converting an old project file 251 | # to a newer Visual Studio version. Backup files are not needed, 252 | # because we have git ;-) 253 | _UpgradeReport_Files/ 254 | Backup*/ 255 | UpgradeLog*.XML 256 | UpgradeLog*.htm 257 | ServiceFabricBackup/ 258 | *.rptproj.bak 259 | 260 | # SQL Server files 261 | *.mdf 262 | *.ldf 263 | *.ndf 264 | 265 | # Business Intelligence projects 266 | *.rdl.data 267 | *.bim.layout 268 | *.bim_*.settings 269 | *.rptproj.rsuser 270 | *- [Bb]ackup.rdl 271 | *- [Bb]ackup ([0-9]).rdl 272 | *- [Bb]ackup ([0-9][0-9]).rdl 273 | 274 | # Microsoft Fakes 275 | FakesAssemblies/ 276 | 277 | # GhostDoc plugin setting file 278 | *.GhostDoc.xml 279 | 280 | # Node.js Tools for Visual Studio 281 | .ntvs_analysis.dat 282 | node_modules/ 283 | 284 | # Visual Studio 6 build log 285 | *.plg 286 | 287 | # Visual Studio 6 workspace options file 288 | *.opt 289 | 290 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 291 | *.vbw 292 | 293 | # Visual Studio LightSwitch build output 294 | **/*.HTMLClient/GeneratedArtifacts 295 | **/*.DesktopClient/GeneratedArtifacts 296 | **/*.DesktopClient/ModelManifest.xml 297 | **/*.Server/GeneratedArtifacts 298 | **/*.Server/ModelManifest.xml 299 | _Pvt_Extensions 300 | 301 | # Paket dependency manager 302 | .paket/paket.exe 303 | paket-files/ 304 | 305 | # FAKE - F# Make 306 | .fake/ 307 | 308 | # Ionide - VsCode extension for F# Support 309 | .ionide/ 310 | 311 | # CodeRush personal settings 312 | .cr/personal 313 | 314 | # Python Tools for Visual Studio (PTVS) 315 | __pycache__/ 316 | *.pyc 317 | 318 | # Cake - Uncomment if you are using it 319 | # tools/** 320 | # !tools/packages.config 321 | 322 | # Tabs Studio 323 | *.tss 324 | 325 | # Telerik's JustMock configuration file 326 | *.jmconfig 327 | 328 | # BizTalk build output 329 | *.btp.cs 330 | *.btm.cs 331 | *.odx.cs 332 | *.xsd.cs 333 | 334 | # OpenCover UI analysis results 335 | OpenCover/ 336 | 337 | # Azure Stream Analytics local run output 338 | ASALocalRun/ 339 | 340 | # MSBuild Binary and Structured Log 341 | *.binlog 342 | 343 | # NVidia Nsight GPU debugger configuration file 344 | *.nvuser 345 | 346 | # MFractors (Xamarin productivity tool) working folder 347 | .mfractor/ 348 | 349 | # Local History for Visual Studio 350 | .localhistory/ 351 | 352 | # BeatPulse healthcheck temp database 353 | healthchecksdb 354 | 355 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 356 | MigrationBackup/ 357 | 358 | # Ionide (cross platform F# VS Code tools) working folder 359 | .ionide/ 360 | 361 | ## 362 | ## Visual studio for Mac 363 | ## 364 | 365 | 366 | # globs 367 | Makefile.in 368 | *.userprefs 369 | *.usertasks 370 | config.make 371 | config.status 372 | aclocal.m4 373 | install-sh 374 | autom4te.cache/ 375 | *.tar.gz 376 | tarballs/ 377 | test-results/ 378 | 379 | # Mac bundle stuff 380 | *.dmg 381 | *.app 382 | 383 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 384 | # General 385 | .DS_Store 386 | .AppleDouble 387 | .LSOverride 388 | 389 | # Icon must end with two \r 390 | Icon 391 | 392 | 393 | # Thumbnails 394 | ._* 395 | 396 | # Files that might appear in the root of a volume 397 | .DocumentRevisions-V100 398 | .fseventsd 399 | .Spotlight-V100 400 | .TemporaryItems 401 | .Trashes 402 | .VolumeIcon.icns 403 | .com.apple.timemachine.donotpresent 404 | 405 | # Directories potentially created on remote AFP share 406 | .AppleDB 407 | .AppleDesktop 408 | Network Trash Folder 409 | Temporary Items 410 | .apdisk 411 | 412 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 413 | # Windows thumbnail cache files 414 | Thumbs.db 415 | ehthumbs.db 416 | ehthumbs_vista.db 417 | 418 | # Dump file 419 | *.stackdump 420 | 421 | # Folder config file 422 | [Dd]esktop.ini 423 | 424 | # Recycle Bin used on file shares 425 | $RECYCLE.BIN/ 426 | 427 | # Windows Installer files 428 | *.cab 429 | *.msi 430 | *.msix 431 | *.msm 432 | *.msp 433 | 434 | # Windows shortcuts 435 | *.lnk 436 | 437 | # JetBrains Rider 438 | .idea/ 439 | *.sln.iml 440 | 441 | ## 442 | ## Visual Studio Code 443 | ## 444 | .vscode/* 445 | !.vscode/settings.json 446 | !.vscode/tasks.json 447 | !.vscode/launch.json 448 | !.vscode/extensions.json 449 | --------------------------------------------------------------------------------