@curveball/kernel
Version:
Curveball is a framework writting in Typescript for Node.js
21 lines (20 loc) • 691 B
TypeScript
/**
* This function is the standard altogrithm to 'guess' the origin of where
* a curveball app is running.
*
* The origin is 'base url', but more specifically it's the URL right up the
* end of the path.
*
* For example: http://localhost is an origin, but https://localhost/ is not.
*
* Knowning where a server is running is often useful. We don't want to
* auto-detect it based on the request, because we can't absolutely trust it.
*
* If the origin was detected wrong, set the CURVEBALL_ORIGIN environemtn
* variable.
*/
export declare function getGlobalOrigin(): string;
/**
* Overrides the global origin
*/
export declare function setGlobalOrigin(origin: string): void;