add notification message

This commit is contained in:
Peter Maquiran
2023-02-02 12:01:18 +01:00
parent 0036ce6ab2
commit ecd19c46bb
41 changed files with 721 additions and 131 deletions
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ServerConnectionService } from './server-connection.service';
describe('ServerConnectionService', () => {
let service: ServerConnectionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ServerConnectionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class ServerConnectionService {
constructor(private http: HttpClient,) { }
async BaseAPI(): Promise<boolean> {
try {
await this.http.get(environment.apiURL)
return true
} catch {
return false
}
}
}