]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/core/config/config.service.ts
Handle blacklist (#84)
[github/Chocobozzz/PeerTube.git] / client / src / app / core / config / config.service.ts
1 import { Injectable } from '@angular/core'
2 import { HttpClient } from '@angular/common/http'
3
4 import { ServerConfig } from '../../../../../shared'
5
6 @Injectable()
7 export class ConfigService {
8 private static BASE_CONFIG_URL = API_URL + '/api/v1/config/'
9
10 private config: ServerConfig = {
11 signup: {
12 allowed: false
13 }
14 }
15
16 constructor (private http: HttpClient) {}
17
18 loadConfig () {
19 this.http.get<ServerConfig>(ConfigService.BASE_CONFIG_URL)
20 .subscribe(data => this.config = data)
21 }
22
23 getConfig () {
24 return this.config
25 }
26 }