refactor keyboard and mouse code: SVG -> div components & logical refactoring. Add some new DEV-features
Some checks failed
CI / checks (push) Failing after 6m56s
Some checks failed
CI / checks (push) Failing after 6m56s
This commit is contained in:
@@ -10,6 +10,7 @@ require('dotenv').config({ path: path.join(__dirname, '..', '.env') });
|
||||
const defaults = {
|
||||
SG_API_FALLBACK_ORIGIN: 'https://sparkguardian.ru',
|
||||
SG_API_BASE_PATH: '/api/v1',
|
||||
SG_INTERACTIVE_PREROLL_MS: '4000',
|
||||
};
|
||||
|
||||
function val(key) {
|
||||
@@ -20,11 +21,20 @@ function val(key) {
|
||||
return defaults[key];
|
||||
}
|
||||
|
||||
function intVal(key) {
|
||||
const parsed = Number.parseInt(val(key), 10);
|
||||
if (Number.isFinite(parsed)) {
|
||||
return parsed;
|
||||
}
|
||||
return Number.parseInt(defaults[key], 10);
|
||||
}
|
||||
|
||||
const content = `// Сгенерировано npm run env:sync — правьте .env и снова запустите sync
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiFallbackOrigin: ${JSON.stringify(val('SG_API_FALLBACK_ORIGIN'))},
|
||||
apiBasePath: ${JSON.stringify(val('SG_API_BASE_PATH'))},
|
||||
interactivePrerollMs: ${JSON.stringify(intVal('SG_INTERACTIVE_PREROLL_MS'))},
|
||||
} as const;
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user