Skip to content

Commit

Permalink
Fix env vars import
Browse files Browse the repository at this point in the history
  • Loading branch information
mrti259 committed May 15, 2024
1 parent 8a07bcf commit 3ebfeef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions my-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
3 changes: 2 additions & 1 deletion my-app/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { env } from '$env/dynamic/private';
import { error } from '@sveltejs/kit';

type Method = 'GET' | 'POST' | 'DELETE' | 'PUT';
Expand All @@ -13,7 +14,7 @@ type Opts = {
body?: string;
};

const base = import.meta.env.VITE_API_URL;
const base = env.VITE_API_URL;

async function send(method: Method, { path, data, headers = {} }: Request) {
const opts: Opts = { method, headers };
Expand Down

0 comments on commit 3ebfeef

Please sign in to comment.