Add util for consistent server url

This commit is contained in:
jeffvli
2022-05-03 20:26:14 -07:00
parent a9836293de
commit 4c01bd2aed

View File

@@ -0,0 +1,9 @@
const getServerUrl = (url: string) => {
if (url[url.length - 1] === '/') {
return `${url}api`;
}
return `${url}/api`;
};
export default getServerUrl;