From e5ecf9f63292d15879418037ea7ce2d37e8f3ecb Mon Sep 17 00:00:00 2001 From: pcsathishgithub <146475036+pcsathishgithub@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:15:09 +0530 Subject: [PATCH 01/12] Initial commit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a4c9a0f --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# first-angular-app \ No newline at end of file From 9d6b2f6451f262d363c4f61fbb350e697ed3e0bd Mon Sep 17 00:00:00 2001 From: Sathish Date: Mon, 16 Oct 2023 23:42:39 +0530 Subject: [PATCH 02/12] Docker conf --- Dockerfile | 3 +++ nginx.conf | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..49f15b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:1.17.1-alpine +COPY nginx.conf /etc/nginx/nginx.conf +COPY /dist /usr/share/nginx/html \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..ade6ad1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +events{} +http { + include /etc/nginx/mime.types; + server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file From 6fbdcf8b4bc75f6c4d013bffedaf4701505f2f5b Mon Sep 17 00:00:00 2001 From: Sathish Date: Mon, 16 Oct 2023 23:43:48 +0530 Subject: [PATCH 03/12] README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4c9a0f..b57af10 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# first-angular-app \ No newline at end of file +# first-angular-app +Sample application to demo a Angular container app \ No newline at end of file From 26348464384d40ddb2798d63156fb7eac07fa726 Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 17 Oct 2023 00:35:59 +0530 Subject: [PATCH 04/12] uri change --- src/app/housing.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/housing.service.ts b/src/app/housing.service.ts index 9ed2554..519b4be 100644 --- a/src/app/housing.service.ts +++ b/src/app/housing.service.ts @@ -6,7 +6,7 @@ import { HousingLocation } from './housinglocation'; }) export class HousingService { - url = 'http://localhost:8080/location'; + url = 'http://localhost:8080/locations'; async getAllHousingLocations(): Promise { const data = await fetch(this.url); From e3adc644c24284ff657f27b25eb8508ef894365b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2023 20:04:25 +0530 Subject: [PATCH 05/12] yaml --- first-angular-app.yaml | 21 +++++++++++++++++++++ first-angular-svc.yaml | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 first-angular-app.yaml create mode 100644 first-angular-svc.yaml diff --git a/first-angular-app.yaml b/first-angular-app.yaml new file mode 100644 index 0000000..8102881 --- /dev/null +++ b/first-angular-app.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: firstappangular-deployment + labels: + app: nginx +spec: + replicas: 3 + selector: + matchLabels: + app: firstappangular + template: + metadata: + labels: + app: firstappangular + spec: + containers: + - name: firstappangular-container + image: docker pull pcsathish1/first-angular-app:1.0 + ports: + - containerPort: 80 diff --git a/first-angular-svc.yaml b/first-angular-svc.yaml new file mode 100644 index 0000000..0b40ff6 --- /dev/null +++ b/first-angular-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: first-angular-service +spec: + selector: + app.kubernetes.io/name: firstappangular + ports: + - protocol: TCP + port: 80 + targetPort: 80 \ No newline at end of file From aea05dd1ddedcba831dc8690fc9732ef77ee6ad4 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Tue, 24 Oct 2023 12:00:03 +0000 Subject: [PATCH 06/12] version 2 --- ...t-angular-app.yaml => first-angular-deployment.yaml | 10 +++++----- first-angular-svc.yaml | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) rename first-angular-app.yaml => first-angular-deployment.yaml (60%) diff --git a/first-angular-app.yaml b/first-angular-deployment.yaml similarity index 60% rename from first-angular-app.yaml rename to first-angular-deployment.yaml index 8102881..0f1dc1a 100644 --- a/first-angular-app.yaml +++ b/first-angular-deployment.yaml @@ -1,21 +1,21 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: firstappangular-deployment + name: firstangular-deployment labels: - app: nginx + app: firstangular-app spec: replicas: 3 selector: matchLabels: - app: firstappangular + app: firstangular-app template: metadata: labels: - app: firstappangular + app: firstangular-app spec: containers: - name: firstappangular-container - image: docker pull pcsathish1/first-angular-app:1.0 + image: pcsathish1/first-angular-app:2.0 ports: - containerPort: 80 diff --git a/first-angular-svc.yaml b/first-angular-svc.yaml index 0b40ff6..2451678 100644 --- a/first-angular-svc.yaml +++ b/first-angular-svc.yaml @@ -1,11 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: first-angular-service + name: firstangular-service + labels: + app: firstangular-app spec: + type: LoadBalancer selector: - app.kubernetes.io/name: firstappangular + app: firstangular-app ports: - protocol: TCP port: 80 - targetPort: 80 \ No newline at end of file + targetPort: 80 From e5178da4af10cc62273ff298ce66f4157282747c Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 24 Oct 2023 20:07:04 +0530 Subject: [PATCH 07/12] nginx --- nginx.conf | 3 +++ src/app/housing.service.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index ade6ad1..3c9f16d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,5 +9,8 @@ http { location / { try_files $uri $uri/ /index.html; } + location /api { + proxy_pass http://springboot-service:8080; + } } } \ No newline at end of file diff --git a/src/app/housing.service.ts b/src/app/housing.service.ts index 519b4be..3c45986 100644 --- a/src/app/housing.service.ts +++ b/src/app/housing.service.ts @@ -6,7 +6,7 @@ import { HousingLocation } from './housinglocation'; }) export class HousingService { - url = 'http://localhost:8080/locations'; + url = 'http://api/locations '; async getAllHousingLocations(): Promise { const data = await fetch(this.url); From bcd38401cdde3c98055e5e0335605a1a7f5dbbf1 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Tue, 24 Oct 2023 15:01:42 +0000 Subject: [PATCH 08/12] curl --- Dockerfile | 3 ++- first-angular-deployment.yaml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 49f15b4..55180a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ FROM nginx:1.17.1-alpine COPY nginx.conf /etc/nginx/nginx.conf -COPY /dist /usr/share/nginx/html \ No newline at end of file +COPY /dist /usr/share/nginx/html +RUN apk --no-cache add curl diff --git a/first-angular-deployment.yaml b/first-angular-deployment.yaml index 0f1dc1a..e9bbeeb 100644 --- a/first-angular-deployment.yaml +++ b/first-angular-deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: app: firstangular-app spec: - replicas: 3 + replicas: 1 selector: matchLabels: app: firstangular-app @@ -16,6 +16,6 @@ spec: spec: containers: - name: firstappangular-container - image: pcsathish1/first-angular-app:2.0 + image: pcsathish1/first-angular-app:3.0 ports: - containerPort: 80 From ac51da9e954783c698e478b260846326e25ff948 Mon Sep 17 00:00:00 2001 From: Sathish Date: Wed, 25 Oct 2023 12:04:17 +0530 Subject: [PATCH 09/12] apach conf --- Dockerfile.apache | 3 ++ httpd.conf | 64 ++++++++++++++++++++++++++++ nginx.conf | 11 ++++- src/app/details/details.component.ts | 1 + src/app/housing.service.ts | 3 +- 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.apache create mode 100644 httpd.conf diff --git a/Dockerfile.apache b/Dockerfile.apache new file mode 100644 index 0000000..817f509 --- /dev/null +++ b/Dockerfile.apache @@ -0,0 +1,3 @@ +FROM httpd:2.4 +COPY /dist /usr/local/apache2/htdocs/ +COPY httpd.conf /usr/local/apache2/conf/httpd.conf \ No newline at end of file diff --git a/httpd.conf b/httpd.conf new file mode 100644 index 0000000..734c4c5 --- /dev/null +++ b/httpd.conf @@ -0,0 +1,64 @@ +# Apache httpd v2.4 minimal configuration +# This can be reduced further if you remove the accees log and mod_log_config +ServerRoot "/usr/local/apache2" + +# Minimum modules needed +LoadModule mpm_event_module modules/mod_mpm_event.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule mime_module modules/mod_mime.so +LoadModule dir_module modules/mod_dir.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule unixd_module modules/mod_unixd.so +LoadModule proxy_module modules/mod_proxy.so +LoadModule proxy_http_module modules/mod_proxy_http.so + +TypesConfig conf/mime.types + +PidFile logs/httpd.pid + +# Comment this out if running httpd as a non root user +User nobody + +# Port to Listen on +Listen *:80 + +# In a basic setup httpd can only serve files from its document root +DocumentRoot "/usr/local/apache2/htdocs/" + + + + + ProxyPreserveHost On + + # Servers to proxy the connection, or; + # List of application servers: + # Usage: + # ProxyPass / http://[IP Addr.]:[port]/ + # ProxyPassReverse / http://[IP Addr.]:[port]/ + # Example: + ProxyPass /api http://localhost:8080/locations/ + ProxyPassReverse /api http://localhost:8080/locations/ + + ServerName localhost + + +# Default file to serve +DirectoryIndex index.html + +# Errors go to their own log +ErrorLog logs/error_log + +# Access log +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog logs/access_log common + +# Never change this block + + AllowOverride None + Require all denied + + +# Allow documents to be served from the DocumentRoot + + Require all granted + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 3c9f16d..0f4ac94 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,6 +1,13 @@ events{} http { include /etc/nginx/mime.types; + # The identifier Backend is internal to nginx, and used to name this specific upstream + upstream Backend { + # springboot-service is the internal DNS name used by the backend Service inside Kubernetes + server springboot-service:8080; + # server 127.0.0.1:8080 max_fails=1 fail_timeout=1s; + # server 127.0.0.1:8080 max_fails=1 fail_timeout=1s; + } server { listen 80; server_name localhost; @@ -9,8 +16,8 @@ http { location / { try_files $uri $uri/ /index.html; } - location /api { - proxy_pass http://springboot-service:8080; + location /api/locations { + proxy_pass http://Backend/locations; } } } \ No newline at end of file diff --git a/src/app/details/details.component.ts b/src/app/details/details.component.ts index 41c013f..9e271d3 100644 --- a/src/app/details/details.component.ts +++ b/src/app/details/details.component.ts @@ -60,6 +60,7 @@ export class DetailsComponent { constructor() { const housingLocationId = parseInt(this.route.snapshot.params['id'], 10); + console.log ("houseing location id"+housingLocationId); this.housingService.getHousingLocationById(housingLocationId).then(housingLocation => { this.housingLocation = housingLocation; }); diff --git a/src/app/housing.service.ts b/src/app/housing.service.ts index 3c45986..35084e8 100644 --- a/src/app/housing.service.ts +++ b/src/app/housing.service.ts @@ -6,7 +6,7 @@ import { HousingLocation } from './housinglocation'; }) export class HousingService { - url = 'http://api/locations '; + url = 'api/locations'; async getAllHousingLocations(): Promise { const data = await fetch(this.url); @@ -14,6 +14,7 @@ export class HousingService { } async getHousingLocationById(id: number): Promise { + console.log(URL + `${this.url}/${id}`); const data = await fetch(`${this.url}/${id}`); return await data.json() ?? {}; } From 6da3776f8fbda47037c60c1c655c4aca8eaba291 Mon Sep 17 00:00:00 2001 From: Sathish Date: Wed, 25 Oct 2023 12:11:03 +0530 Subject: [PATCH 10/12] spring boot dns --- nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 0f4ac94..dd212cb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,7 +4,8 @@ http { # The identifier Backend is internal to nginx, and used to name this specific upstream upstream Backend { # springboot-service is the internal DNS name used by the backend Service inside Kubernetes - server springboot-service:8080; + server springboot-service:8080; + #server 192.168.1.7:8080; # server 127.0.0.1:8080 max_fails=1 fail_timeout=1s; # server 127.0.0.1:8080 max_fails=1 fail_timeout=1s; } From 8b254db45160704420686d6647ad6517dce9365e Mon Sep 17 00:00:00 2001 From: Sathish Date: Wed, 25 Oct 2023 14:57:26 +0530 Subject: [PATCH 11/12] logging in angular --- src/app/app.component.ts | 10 +- src/app/app.module.ts | 31 +++++ src/app/app.routing.module.ts | 31 +++++ src/app/home/home.component.ts | 5 - .../housing-location.component.ts | 6 +- src/app/housing.service.ts | 11 +- .../shared/log-test/log-test.component.html | 1 + src/app/shared/log-test/log-test.component.ts | 15 +++ src/app/shared/log.service.ts | 106 ++++++++++++++++++ src/main.ts | 29 +++-- tsconfig.json | 1 + 11 files changed, 209 insertions(+), 37 deletions(-) create mode 100644 src/app/app.module.ts create mode 100644 src/app/app.routing.module.ts create mode 100644 src/app/shared/log-test/log-test.component.html create mode 100644 src/app/shared/log-test/log-test.component.ts create mode 100644 src/app/shared/log.service.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 677712d..301a9a9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,17 +1,10 @@ import { Component } from '@angular/core'; -import { HomeComponent } from './home/home.component'; -import { RouterLink, RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', - standalone: true, - imports: [ - HomeComponent, - RouterLink, - RouterOutlet, - ], template: `
+
@@ -20,6 +13,7 @@ import { RouterLink, RouterOutlet } from '@angular/router';
+
`, styleUrls: ['./app.component.css'], diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..d0b2511 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,31 @@ +import { NgModule } from "@angular/core"; +import { HomeComponent } from "./home/home.component"; +import { RouterLink, RouterOutlet } from "@angular/router"; +import { AppComponent } from "./app.component"; +import { LogTestComponent } from "./shared/log-test/log-test.component"; +import { BrowserModule } from "@angular/platform-browser"; +import { AppRoutingModule } from "./app.routing.module"; +import { HousingLocationComponent } from "./housing-location/housing-location.component"; +import { LogService } from "./shared/log.service"; + + + +@NgModule({ + imports: [ + BrowserModule, + AppRoutingModule, + ], + declarations: [ + AppComponent, HomeComponent, HousingLocationComponent, LogTestComponent + ], + providers: [LogService], + bootstrap: [ AppComponent ] +}) +export class AppModule { } + + +/* +Copyright Google LLC. All Rights Reserved. +Use of this source code is governed by an MIT-style license that +can be found in the LICENSE file at https://angular.io/license +*/ \ No newline at end of file diff --git a/src/app/app.routing.module.ts b/src/app/app.routing.module.ts new file mode 100644 index 0000000..d6f0e3d --- /dev/null +++ b/src/app/app.routing.module.ts @@ -0,0 +1,31 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { HomeComponent } from './home/home.component'; +import { DetailsComponent } from './details/details.component'; + +const routeConfig: Routes = [ + { + path: '', + component: HomeComponent, + title: 'Home page' + }, + { + path: 'details/:id', + component: DetailsComponent, + title: 'Home details' + } + ]; + + +@NgModule({ + imports: [ RouterModule.forRoot(routeConfig) ], + exports: [ RouterModule ] +}) +export class AppRoutingModule {} + + +/* +Copyright Google LLC. All Rights Reserved. +Use of this source code is governed by an MIT-style license that +can be found in the LICENSE file at https://angular.io/license +*/ \ No newline at end of file diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 208ce80..55084ee 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -6,11 +6,6 @@ import { HousingService } from '../housing.service'; @Component({ selector: 'app-home', - standalone: true, - imports: [ - CommonModule, - HousingLocationComponent - ], template: `
diff --git a/src/app/housing-location/housing-location.component.ts b/src/app/housing-location/housing-location.component.ts index 0834923..1f014af 100644 --- a/src/app/housing-location/housing-location.component.ts +++ b/src/app/housing-location/housing-location.component.ts @@ -5,11 +5,6 @@ import { RouterModule } from '@angular/router'; @Component({ selector: 'app-housing-location', - standalone: true, - imports: [ - CommonModule, - RouterModule - ], template: `
Exterior photo of {{housingLocation.name}} @@ -17,6 +12,7 @@ import { RouterModule } from '@angular/router';

{{ housingLocation.city}}, {{housingLocation.state }}

Learn More
+ `, styleUrls: ['./housing-location.component.css'], }) diff --git a/src/app/housing.service.ts b/src/app/housing.service.ts index 35084e8..1802030 100644 --- a/src/app/housing.service.ts +++ b/src/app/housing.service.ts @@ -1,5 +1,6 @@ -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { HousingLocation } from './housinglocation'; +import { LogService } from './shared/log.service'; @Injectable({ providedIn: 'root' @@ -7,19 +8,23 @@ import { HousingLocation } from './housinglocation'; export class HousingService { url = 'api/locations'; + //url = 'http://localhost:8080/locations'; + + logger: LogService = inject(LogService); async getAllHousingLocations(): Promise { + this.logger.log("URL to get data", this.url); const data = await fetch(this.url); return await data.json() ?? []; } async getHousingLocationById(id: number): Promise { - console.log(URL + `${this.url}/${id}`); + this.logger.debug("URL to get by data by id", `${this.url}/${id}`); const data = await fetch(`${this.url}/${id}`); return await data.json() ?? {}; } submitApplication(firstName: string, lastName: string, email: string) { - console.log(firstName, lastName, email); + this.logger.log(firstName, lastName, email); } } diff --git a/src/app/shared/log-test/log-test.component.html b/src/app/shared/log-test/log-test.component.html new file mode 100644 index 0000000..3a8f126 --- /dev/null +++ b/src/app/shared/log-test/log-test.component.html @@ -0,0 +1 @@ + diff --git a/src/app/shared/log-test/log-test.component.ts b/src/app/shared/log-test/log-test.component.ts new file mode 100644 index 0000000..1b9ed22 --- /dev/null +++ b/src/app/shared/log-test/log-test.component.ts @@ -0,0 +1,15 @@ +import { Component } from "@angular/core"; +import { LogService } from '../log.service'; + +@Component({ + selector: "log-test", + templateUrl: "./log-test.component.html" +}) +export class LogTestComponent { + constructor(private logger: LogService) { + } + + testLog(): void { + this.logger.log("Test the `log()` Method"); + } +} diff --git a/src/app/shared/log.service.ts b/src/app/shared/log.service.ts new file mode 100644 index 0000000..500b7e1 --- /dev/null +++ b/src/app/shared/log.service.ts @@ -0,0 +1,106 @@ +import { Injectable } from '@angular/core'; + + +export enum LogLevel { + All = 0, + Debug = 1, + Info = 2, + Warn = 3, + Error = 4, + Fatal = 5, + Off = 6 +} + +@Injectable() +export class LogService { + level: LogLevel = LogLevel.All; + logWithDate: boolean = true; + + debug(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.Debug, optionalParams); + } + + info(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.Info, optionalParams); + } + + warn(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.Warn, optionalParams); + } + + error(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.Error, optionalParams); + } + + fatal(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.Fatal, optionalParams); + } + + log(msg: string, ...optionalParams: any[]) { + this.writeToLog(msg, LogLevel.All, optionalParams); + } + + private writeToLog(msg: string, level: LogLevel, params: any[]) { + if (this.shouldLog(level)) { + let entry: LogEntry = new LogEntry(); + entry.message = msg; + entry.level = level; + entry.extraInfo = params; + entry.logWithDate = this.logWithDate; + console.log(entry.buildLogString()); + } + } + + + private shouldLog(level: LogLevel): boolean { + let ret: boolean = false; + if ((level >= this.level && level !== LogLevel.Off) || this.level === LogLevel.All) { + ret = true; + } + return ret; + } + + +} + +export class LogEntry { + // Public Properties + entryDate: Date = new Date(); + message: string = ""; + level: LogLevel = LogLevel.Debug; + extraInfo: any[] = []; + logWithDate: boolean = true; + + buildLogString(): string { + let ret: string = ""; + + if (this.logWithDate) { + ret = new Date() + " - "; + } + + ret += "Type: " + LogLevel[this.level]; + ret += " - Message: " + this.message; + if (this.extraInfo.length) { + ret += " - Extra Info: " + this.formatParams(this.extraInfo); + } + + return ret; + } + + private formatParams(params: any[]): string { + let ret: string = params.join(","); + + // Is there at least one object in the array? + if (params.some(p => typeof p == "object")) { + ret = ""; + + // Build comma-delimited string + for (let item of params) { + ret += JSON.stringify(item) + ","; + } + } + + return ret; + } +} + diff --git a/src/main.ts b/src/main.ts index fe1364a..aad341e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,17 +1,14 @@ -/* -* Protractor support is deprecated in Angular. -* Protractor is used in this example for compatibility with Angular documentation tools. -*/ -import { bootstrapApplication,provideProtractorTestingSupport } from '@angular/platform-browser'; -import { AppComponent } from './app/app.component'; -import { provideRouter } from '@angular/router'; -import routeConfig from './app/routes'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); -bootstrapApplication(AppComponent, - { - providers: [ - provideProtractorTestingSupport(), - provideRouter(routeConfig) - ] - } -).catch(err => console.error(err)); + + +/* +Copyright Google LLC. All Rights Reserved. +Use of this source code is governed by an MIT-style license that +can be found in the LICENSE file at https://angular.io/license +*/ \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index fd60dd3..516e51f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ { "compileOnSave": false, "compilerOptions": { + "strictPropertyInitialization": false, "baseUrl": "./", "outDir": "./dist/out-tsc", "forceConsistentCasingInFileNames": true, From fef7a8e3df6dd562a3ccc8aaeb31bd92debfbf89 Mon Sep 17 00:00:00 2001 From: Sathish Date: Wed, 25 Oct 2023 15:09:26 +0530 Subject: [PATCH 12/12] api locations --- src/app/housing.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/housing.service.ts b/src/app/housing.service.ts index 1802030..214e852 100644 --- a/src/app/housing.service.ts +++ b/src/app/housing.service.ts @@ -7,7 +7,7 @@ import { LogService } from './shared/log.service'; }) export class HousingService { - url = 'api/locations'; + url = 'api/locations'; //url = 'http://localhost:8080/locations'; logger: LogService = inject(LogService);