mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
Allow overriding the API url using an environment variable (#4502)
This commit is contained in:
@@ -126,7 +126,7 @@ export enum UpdateURL {
|
||||
}
|
||||
|
||||
// API
|
||||
export const API_BASE_URL = 'https://api.insomnia.rest';
|
||||
export const getApiBaseURL = () => process.env.INSOMNIA_API_URL || 'https://api.insomnia.rest';
|
||||
|
||||
// SYNC
|
||||
export const DEFAULT_BRANCH_NAME = 'master';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { bindActionCreators, combineReducers, Store } from 'redux';
|
||||
|
||||
import * as fetch from '../../../account/fetch';
|
||||
import { isLoggedIn, onLoginLogout } from '../../../account/session';
|
||||
import { API_BASE_URL, getClientString } from '../../../common/constants';
|
||||
import { getApiBaseURL, getClientString } from '../../../common/constants';
|
||||
import { database as db } from '../../../common/database';
|
||||
import configureStore from '../create';
|
||||
import * as entities from './entities';
|
||||
@@ -25,7 +25,7 @@ export async function init(): Promise<Store> {
|
||||
loginStateChange(loggedIn);
|
||||
});
|
||||
// Bind to fetch commands
|
||||
fetch.setup(getClientString(), API_BASE_URL);
|
||||
fetch.setup(getClientString(), getApiBaseURL());
|
||||
fetch.onCommand(newCommand);
|
||||
|
||||
for (const action of global.init()) {
|
||||
|
||||
Reference in New Issue
Block a user