frontend-zackeneule/source/logic/conf.ts

43 lines
526 B
TypeScript

namespace _espe.conf
{
/**
*/
export type type_data = {
backend : {
scheme : string;
host : string;
port : int;
path_base : string;
};
};
/**
*/
var _data : (null | type_data) = null;
/**
*/
export async function load(
) : Promise<void>
{
_data = lib_plankton.json.decode(await lib_plankton.file.read("conf.json"));
}
/**
*/
export function get(
) : type_data
{
if (_data === null) {
throw (new Error("conf not loaded yet"));
}
else {
return _data;
}
}
}