Take Flashii URL instead of Flashii API url.
This commit is contained in:
parent
6910514f72
commit
604c137671
4 changed files with 8 additions and 7 deletions
|
@ -8,9 +8,9 @@
|
|||
# Sets the title of the application, might be overridden for the window title by the common settings below once they're loaded
|
||||
#MAMI_TITLE="Flashii Chat"
|
||||
|
||||
# Flashii API base URL
|
||||
# Sets the base URL for Flashii API, without the version part!
|
||||
#MAMI_API_URL="//flashii.net/api"
|
||||
# Flashii base URL
|
||||
# Sets the base URL for Flashii
|
||||
#MAMI_FII_URL="//flashii.net"
|
||||
|
||||
# Common configuration location
|
||||
# Contains further information shared by the other chat client
|
||||
|
|
2
build.js
2
build.js
|
@ -18,7 +18,7 @@ const exec = require('util').promisify(require('child_process').exec);
|
|||
html: { title },
|
||||
build: {
|
||||
FUTAMI_DEBUG: isDebug,
|
||||
FII_API: process.env.MAMI_API_URL ?? '//flashii.net/api',
|
||||
FII_URL: process.env.MAMI_FII_URL ?? '//flashii.net',
|
||||
FUTAMI_URL: process.env.FUTAMI_URL ?? '//futami.flashii.net/common.json',
|
||||
AMI_URL: process.env.AMI_URL ?? '//sockchat.flashii.net',
|
||||
GIT_HASH: (await exec('git log --pretty="%H" -n1 HEAD')).stdout,
|
||||
|
|
|
@ -13,7 +13,7 @@ const MamiContext = function(globalEventTarget, eventTarget) {
|
|||
if(typeof eventTarget === 'string')
|
||||
eventTarget = globalEventTarget.scopeTo(eventTarget);
|
||||
|
||||
const flashii = new Flashii;
|
||||
const flashii = new Flashii(`${window.FII_URL}/api`);
|
||||
|
||||
let isUnloading = false;
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include xhr.js
|
||||
|
||||
const Flashii = function(baseUrl=null) {
|
||||
baseUrl ??= window.FII_API;
|
||||
const Flashii = function(baseUrl) {
|
||||
if(typeof baseUrl !== 'string')
|
||||
throw new Error('baseUrl must be a string');
|
||||
if(baseUrl.startsWith('//'))
|
||||
baseUrl = window.location.protocol + baseUrl;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue