Front: Fix env var

This commit is contained in:
Arthur Jamet
2023-10-02 16:56:46 +02:00
parent 920126a392
commit 4299a93afe
6 changed files with 33 additions and 2 deletions

View File

@@ -8,8 +8,8 @@ POSTGRES_DB=chromacase
API_URL=http://localhost:80/api
SCORO_URL=ws://localhost:6543
MINIO_ROOT_PASSWORD=12345678
EXPO_PUBLIC_API_URL=$API_URL
EXPO_PUBLIC_SCORO_URL=$SCORO_URL
EXPO_PUBLIC_API_URL=http://localhost:80/api
EXPO_PUBLIC_SCORO_URL=ws://localhost:6543
GOOGLE_CLIENT_ID=toto
GOOGLE_SECRET=tata
GOOGLE_CALLBACK_URL=http://localhost:19006/logged/google

View File

@@ -23,6 +23,7 @@ import { AccessTokenResponseHandler } from './models/AccessTokenResponse';
import * as yup from 'yup';
import { base64ToBlob } from './utils/base64ToBlob';
import { ImagePickerAsset } from 'expo-image-picker';
import Constants from 'expo-constants';
type AuthenticationInput = { username: string; password: string };
type RegistrationInput = AuthenticationInput & { email: string };

View File

@@ -2,6 +2,19 @@ module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
[
'module:react-native-dotenv',
{
moduleName: '@env',
path: '.env',
blacklist: null,
whitelist: null,
safe: false,
allowUndefined: true,
},
],
],
// plugins: ['@babel/plugin-proposal-export-namespace-from', 'react-native-reanimated/plugin'],
// env: {
// production: {

View File

@@ -6,6 +6,10 @@
"gradleCommand": ":app:assembleDebug",
"developmentClient": true,
"distribution": "internal"
},
"env": {
"EXPO_PUBLIC_API_URL": "https://chroma.octohub.app/api",
"EXPO_PUBLIC_SCORO_URL": "wss://chroma.octohub.app/ws"
}
},
"production": {

View File

@@ -43,6 +43,7 @@
"react-i18next": "^13.2.2",
"react-native": "0.72.5",
"react-native-chart-kit": "^6.12.0",
"react-native-dotenv": "^3.4.9",
"react-native-pager-view": "6.2.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",

View File

@@ -5564,6 +5564,11 @@ dotenv-expand@~10.0.0:
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37"
integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==
dotenv@^16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==
dotenv@~16.0.3:
version "16.0.3"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07"
@@ -10530,6 +10535,13 @@ react-native-chart-kit@^6.12.0:
paths-js "^0.4.10"
point-in-polygon "^1.0.1"
react-native-dotenv@^3.4.9:
version "3.4.9"
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-3.4.9.tgz#621c5b0c1d0c5c7f569bfe5a1d804bec7885c010"
integrity sha512-dbyd+mcy7SUzxEgmt33TRf1FGcNe6swJhXmB0unKkI49F7+pidog9kPtjxMLTAfmKA8gcN2XHQSKltGfGbGCLQ==
dependencies:
dotenv "^16.3.1"
react-native-pager-view@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-6.2.0.tgz#51380d93fbe47f6380dc71d613a787bf27a4ca37"