mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
fix: relax bundle config requirements and default assetsBaseUrl
This commit is contained in:
@@ -34,13 +34,12 @@ Initial project version: `0.1.0`.
|
|||||||
|
|
||||||
La descarga de assets usa **únicamente HTTP**. Debes configurar un servidor propio.
|
La descarga de assets usa **únicamente HTTP**. Debes configurar un servidor propio.
|
||||||
|
|
||||||
1. En `cfg/scoreko-dev.json`, configura `assetsBaseUrl` (obligatorio):
|
1. En `cfg/scoreko-dev.json`, configura `assetsBaseUrl` (opcional, por defecto `http://localhost`):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"scoreko-dev": {
|
"scoreko-dev": {
|
||||||
"exampleProperty": "value",
|
"assetsBaseUrl": "http://localhost"
|
||||||
"assetsBaseUrl": "http://TU_SERVIDOR:8080"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
+5
-6
@@ -4,7 +4,8 @@
|
|||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"exampleProperty": {
|
"exampleProperty": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
},
|
},
|
||||||
"startggClientId": {
|
"startggClientId": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -42,11 +43,9 @@
|
|||||||
},
|
},
|
||||||
"assetsBaseUrl": {
|
"assetsBaseUrl": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "URL base obligatoria para descargar assets por HTTP (ej: http://192.168.1.50:8080)."
|
"default": "http://localhost",
|
||||||
|
"description": "URL base para descargar assets por HTTP (ej: http://192.168.1.50:8080). Por defecto usa http://localhost."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": []
|
||||||
"exampleProperty",
|
|
||||||
"assetsBaseUrl"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ const requestHeaders = {
|
|||||||
const getConfiguredAssetsBaseUrl = () => {
|
const getConfiguredAssetsBaseUrl = () => {
|
||||||
const configuredValue = nodecg.bundleConfig.assetsBaseUrl;
|
const configuredValue = nodecg.bundleConfig.assetsBaseUrl;
|
||||||
if (typeof configuredValue !== 'string') {
|
if (typeof configuredValue !== 'string') {
|
||||||
throw new Error('La configuración assetsBaseUrl es obligatoria y debe ser un string.');
|
return 'http://localhost';
|
||||||
}
|
}
|
||||||
|
|
||||||
const trimmed = configuredValue.trim();
|
const trimmed = configuredValue.trim();
|
||||||
if (!trimmed) {
|
if (!trimmed) {
|
||||||
throw new Error('La configuración assetsBaseUrl es obligatoria para descargar assets por HTTP.');
|
return 'http://localhost';
|
||||||
}
|
}
|
||||||
|
|
||||||
return trimmed.replace(/\/+$/, '');
|
return trimmed.replace(/\/+$/, '');
|
||||||
|
|||||||
Vendored
+3
-3
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export interface Configschema {
|
export interface Configschema {
|
||||||
exampleProperty: string;
|
exampleProperty?: string;
|
||||||
/**
|
/**
|
||||||
* Client ID de tu OAuth app de start.gg
|
* Client ID de tu OAuth app de start.gg
|
||||||
*/
|
*/
|
||||||
@@ -33,7 +33,7 @@ export interface Configschema {
|
|||||||
*/
|
*/
|
||||||
challongeOAuthPort?: number;
|
challongeOAuthPort?: number;
|
||||||
/**
|
/**
|
||||||
* URL base obligatoria para descargar assets por HTTP (ej: http://192.168.1.50:8080).
|
* URL base para descargar assets por HTTP (ej: http://192.168.1.50:8080). Por defecto usa http://localhost.
|
||||||
*/
|
*/
|
||||||
assetsBaseUrl: string;
|
assetsBaseUrl?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user