mirror of https://github.com/statping/statping
feat: checking env variables
parent
db9e6d6040
commit
ce71c9c803
|
@ -20,8 +20,7 @@ COPY ./react-frontend/yarn.lock .
|
|||
COPY ./react-frontend/.npmrc .
|
||||
RUN yarn install --pure-lockfile --network-timeout 1000000
|
||||
COPY ./react-frontend/ .
|
||||
COPY ./react-frontend/.env.production .
|
||||
RUN yarn build:production && yarn cache clean
|
||||
RUN yarn build && yarn cache clean
|
||||
|
||||
# Statping Golang BACKEND building from source
|
||||
# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
REACT_APP_LUMBERJACK_API_URL="https://lumberjack.stage.razorpay.in/v1/track"
|
||||
REACT_APP_LUMBERJACK_API_KEY='10pYUm55sa39zgTN1gzNwQzNyQjM54Cg'
|
|
@ -0,0 +1,2 @@
|
|||
REACT_APP_LUMBERJACK_API_URL="https://lumberjack.razorpay.com/v1/track"
|
||||
REACT_APP_LUMBERJACK_API_KEY='10pYUm55sa39zgTN1gzNwQzNyQjM54Cg'
|
|
@ -3,9 +3,8 @@
|
|||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "rm -rf build && GENERATE_SOURCEMAP=false react-scripts build",
|
||||
"build:production": "rm -rf build && GENERATE_SOURCEMAP=false REACT_APP_ENV=production react-scripts build",
|
||||
"start": "env-cmd -f ./configs/dev.env react-scripts start",
|
||||
"build": "env-cmd -f ./configs/prod.env rm -rf build && GENERATE_SOURCEMAP=false react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
|
@ -22,6 +21,7 @@
|
|||
"apexcharts": "^3.28.1",
|
||||
"axios": "^0.21.1",
|
||||
"date-fns": "^2.23.0",
|
||||
"env-cmd": "^10.1.0",
|
||||
"framer-motion": "^4",
|
||||
"node-sass": "^6.0.1",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -39,7 +39,5 @@
|
|||
<script type="text/javaScript">
|
||||
window.LUMBERJACK_API_URL = "%REACT_APP_LUMBERJACK_API_URL%";
|
||||
window.LUMBERJACK_API_KEY = "%REACT_APP_LUMBERJACK_API_KEY%";
|
||||
|
||||
console.log(window)
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -7,7 +7,7 @@ import Navigation from "./Navbar";
|
|||
import { initLumberjack } from "../utils/trackers";
|
||||
|
||||
const App = () => {
|
||||
console.log(`Application running on ${JSON.stringify(process.env)} mode.`);
|
||||
console.log(`Application running on ${process.env.NODE_ENV} mode.`);
|
||||
useEffect(() => {
|
||||
initLumberjack();
|
||||
}, [])
|
||||
|
|
|
@ -4,7 +4,7 @@ import { titleCase } from './helper';
|
|||
export const sendToLumberjack = ({ eventName, properties = {} }) => {
|
||||
const body = {
|
||||
mode: 'live',
|
||||
key: '10pYUm55sa39zgTN1gzNwQzNyQjM54Cg',
|
||||
key: window.LUMBERJACK_API_KEY,
|
||||
events: [
|
||||
{
|
||||
event_type: 'website',
|
||||
|
@ -18,7 +18,7 @@ export const sendToLumberjack = ({ eventName, properties = {} }) => {
|
|||
],
|
||||
};
|
||||
|
||||
fetch('https://lumberjack.stage.razorpay.in/v1/track', {
|
||||
fetch(window.LUMBERJACK_API_URL, {
|
||||
method: 'post',
|
||||
body: JSON.stringify(body),
|
||||
headers: {
|
||||
|
|
|
@ -3,7 +3,7 @@ import analyticsService from '@razorpay/universe-utils/analytics';
|
|||
export const initLumberjack = () => {
|
||||
analyticsService.init({
|
||||
lumberjackAppName: 'website',
|
||||
lumberjackApiKey: '10pYUm55sa39zgTN1gzNwQzNyQjM54Cg',
|
||||
lumberjackApiUrl: "https://lumberjack.stage.razorpay.in/v1/track",
|
||||
lumberjackApiKey: window.LUMBERJACK_API_KEY,
|
||||
lumberjackApiUrl: window.LUMBERJACK_API_URL,
|
||||
});
|
||||
};
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue