Fix dev
This commit is contained in:
parent
913abb7642
commit
7412bc8af5
1 changed files with 15 additions and 1 deletions
|
|
@ -6,7 +6,21 @@
|
||||||
* only shows a server once it responds, so listing an offline origin here is
|
* only shows a server once it responds, so listing an offline origin here is
|
||||||
* harmless. Add or remove origins as you deploy more server containers.
|
* harmless. Add or remove origins as you deploy more server containers.
|
||||||
*/
|
*/
|
||||||
const servers: Array<string> = ['https://server.decla.red'];
|
const productionServers: Array<string> = ['https://declared.schmelczer.dev'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the page is served from localhost (i.e. the webpack-dev-server), also
|
||||||
|
* offer the local backend so a `npm start` server can be joined during
|
||||||
|
* development. The backend's default port is 3000 (see backend/src/options.ts).
|
||||||
|
* In production the hostname is `declared.schmelczer.dev`, so this never leaks.
|
||||||
|
*/
|
||||||
|
const isDevelopment =
|
||||||
|
typeof location !== 'undefined' &&
|
||||||
|
(location.hostname === 'localhost' || location.hostname === '127.0.0.1');
|
||||||
|
|
||||||
|
const servers: Array<string> = isDevelopment
|
||||||
|
? [`http://${location.hostname}:3000`, ...productionServers]
|
||||||
|
: productionServers;
|
||||||
|
|
||||||
export abstract class Configuration {
|
export abstract class Configuration {
|
||||||
public static async initialize(): Promise<void> {
|
public static async initialize(): Promise<void> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue