1 import { isBrowser } from './utils';
3 const nodeHostname = process.env.LEMMY_HOST || 'localhost'; // used for local dev
4 const host = isBrowser() ? window.location.hostname : nodeHostname;
5 const secure = isBrowser() && window.location.protocol == 'https:' ? 's' : '';
6 const port = isBrowser()
7 ? window.location.port == '1234' || window.location.port == '1235'
11 const endpoint = `${host}:${port}`;
13 export const wsUri = `ws${secure}://${endpoint}/api/v1/ws`;
14 export const httpUri = `http${secure}://${endpoint}/api/v1`;