Support passing env values
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { questionnaireMetaData } from "./store/answers";
|
||||
export let open;
|
||||
export let onClose;
|
||||
export let submissionId;
|
||||
// export let submissionId;
|
||||
|
||||
// get submission data by submissionId;
|
||||
|
||||
|
||||
+8
-16
@@ -1,17 +1,9 @@
|
||||
let ENV = process.env;
|
||||
|
||||
export const getConfig = (_env) => {
|
||||
if (!!_env) {
|
||||
ENV = { ...ENV, ..._env };
|
||||
}
|
||||
|
||||
return {
|
||||
port: ENV.PORT,
|
||||
nodeEnv: ENV.NODE_ENV,
|
||||
isProd: ENV.NODE_ENV === 'development',
|
||||
supabaseConfig: {
|
||||
url: ENV.SVELTE_APP_SUPABASE_URL,
|
||||
anonKey: ENV.SVELTE_APP_SUPABASE_ANON_KEY,
|
||||
},
|
||||
};
|
||||
export default {
|
||||
port: process.env.PORT,
|
||||
nodeEnv: process.env.NODE_ENV,
|
||||
isProd: process.env.NODE_ENV === 'development',
|
||||
supabaseConfig: {
|
||||
url: process.env.SVELTE_APP_SUPABASE_URL,
|
||||
anonKey: process.env.SVELTE_APP_SUPABASE_ANON_KEY,
|
||||
},
|
||||
};
|
||||
|
||||
+1
-3
@@ -5,9 +5,7 @@ import polka from 'polka';
|
||||
import compression from 'compression';
|
||||
import * as sapper from '@sapper/server';
|
||||
|
||||
import { getConfig } from './config';
|
||||
|
||||
const config = getConfig(dotenv.config().parsed);
|
||||
import config from './config';
|
||||
|
||||
polka() // You can also use Express
|
||||
.use(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
import getConfig from '../../config';
|
||||
const config = getConfig();
|
||||
import config from '../../config';
|
||||
|
||||
export const supabase = createClient(
|
||||
config.supabaseConfig.url,
|
||||
|
||||
Reference in New Issue
Block a user