telesto🌛
telesto🌛5d ago

Using something like environment variables in fresh🍋

Is there anything I could use to use different (environment) variables in fresh? It is sort of implied in deno.json already:
"start": "deno run -A --watch=static/,routes/ dev.ts",
"build": "deno run -A dev.ts build"
"start": "deno run -A --watch=static/,routes/ dev.ts",
"build": "deno run -A dev.ts build"
and dev.ts is
#!/usr/bin/env -S deno run -A --watch=static/,routes/

import dev from '$fresh/dev.ts';
import config from './fresh.config.ts';

import '$std/dotenv/load.ts';

await dev(import.meta.url, './main.ts', config);
#!/usr/bin/env -S deno run -A --watch=static/,routes/

import dev from '$fresh/dev.ts';
import config from './fresh.config.ts';

import '$std/dotenv/load.ts';

await dev(import.meta.url, './main.ts', config);
but that is set to FreshConfig. I'd like to set additional fields which I can use to set an api key or a base url. Is there something I could do?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?