mirror of
https://github.com/owncast/owncast.git
synced 2024-12-30 13:08:30 +03:00
15 lines
No EOL
383 B
JavaScript
15 lines
No EOL
383 B
JavaScript
class Config {
|
|
async init() {
|
|
const configFileLocation = "./js/config.json";
|
|
|
|
try {
|
|
const response = await fetch(configFileLocation);
|
|
const configData = await response.json();
|
|
Object.assign(this, configData);
|
|
return this;
|
|
} catch(error) {
|
|
console.log(error);
|
|
// No config file present. That's ok. It's not required.
|
|
}
|
|
}
|
|
} |