mirror of
https://github.com/jeffvli/sonixd.git
synced 2026-04-29 10:42:40 -04:00
Add util for consistent server url
This commit is contained in:
9
src/renderer/utils/getServerUrl.ts
Normal file
9
src/renderer/utils/getServerUrl.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
const getServerUrl = (url: string) => {
|
||||
if (url[url.length - 1] === '/') {
|
||||
return `${url}api`;
|
||||
}
|
||||
|
||||
return `${url}/api`;
|
||||
};
|
||||
|
||||
export default getServerUrl;
|
||||
Reference in New Issue
Block a user