mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-11 12:25:42 +03:00
get api url from .env file
This commit is contained in:
parent
1d1c500c63
commit
ecdf3fef23
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
||||
PUBLIC_API_BASE_URL=https://test.app.gitbutler.com/
|
1
.env.production
Normal file
1
.env.production
Normal file
@ -0,0 +1 @@
|
||||
PUBLIC_API_BASE_URL=https://app.gitbutler.com/
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,6 +26,4 @@ dist-ssr
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { dev } from "$app/environment";
|
||||
import { PUBLIC_API_BASE_URL } from "$env/static/public";
|
||||
import * as log from "$lib/log";
|
||||
|
||||
const apiUrl = dev
|
||||
? new URL("https://test.app.gitbutler.com/api/")
|
||||
: new URL("https://app.gitbutler.com/api/");
|
||||
const apiUrl = new URL("/api/", new URL(PUBLIC_API_BASE_URL));
|
||||
|
||||
const getUrl = (path: string) => new URL(path, apiUrl).toString();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user