数字我 Digital Me:全量入库(大文件走 Git LFS)
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import { resolveApiBase } from '../src/lib/apiBase.ts';
|
||||
|
||||
test('Docker same-origin sentinel uses the current Nginx origin', () => {
|
||||
assert.equal(resolveApiBase('same-origin', '127.0.0.1'), '');
|
||||
});
|
||||
|
||||
test('an explicit API URL wins over hostname defaults', () => {
|
||||
assert.equal(resolveApiBase('https://api.example.test', 'digitalme.invoratec.cn'), 'https://api.example.test');
|
||||
});
|
||||
|
||||
test('unset API URL keeps production and local development defaults', () => {
|
||||
assert.equal(resolveApiBase(undefined, 'digitalme.invoratec.cn'), 'https://digitalme-api.invoratec.cn');
|
||||
assert.equal(resolveApiBase(undefined, 'localhost'), 'http://localhost:3701');
|
||||
});
|
||||
Reference in New Issue
Block a user