Skip to content

Commit

Permalink
Merge pull request #36 from ResilientApp/envFix
Browse files Browse the repository at this point in the history
"Hard coded env values for deployment"
  • Loading branch information
Saipranav-Kotamreddy authored May 23, 2024
2 parents 0836c7f + 643cdb4 commit 767dda9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 130 deletions.
128 changes: 4 additions & 124 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/APIs/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import axios from "axios";

export const sendGet = async (key) => {
let url = process.env.REACT_APP_SEND_GET_URL + key;
//let url = process.env.REACT_APP_SEND_GET_URL + key;
let url = "http://127.0.0.1:18000/v1/transactions/" + key;
try {
const response = await axios.get(url);
// console.log("Get response: ", response.data);
Expand All @@ -14,7 +15,8 @@ export const sendGet = async (key) => {

export const sendPost = async (key, value) => {
let data = { "id": key, "value": value };
let url = process.env.REACT_APP_SEND_POST_URL;
//let url = process.env.REACT_APP_SEND_POST_URL;
let url = "http://127.0.0.1:18000/v1/transactions/commit";
try {
const response = await axios.post(
url,
Expand Down
6 changes: 4 additions & 2 deletions src/Components/Pages/Visualizer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ const Visualizer = () => {
let results = [false, false, false, false];

for (let i = 0; i < 4; i++) {
let port= parseInt(process.env.REACT_APP_DEFAULT_LOCAL_PORT)+i
let url = process.env.REACT_APP_DEFAULT_LOCAL + String(port) + process.env.REACT_APP_REPLICA_STATUS_EP
//let port= parseInt(process.env.REACT_APP_DEFAULT_LOCAL_PORT)+i
//let url = process.env.REACT_APP_DEFAULT_LOCAL + String(port) + process.env.REACT_APP_REPLICA_STATUS_EP
let port= parseInt(18501)+i
let url = "http://localhost:" + String(port) + "/get_status"
let promise = fetchWithTimeout(url)
.then(response => {
return response.text();
Expand Down
6 changes: 4 additions & 2 deletions src/Socket/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ export const WebSocket = ({onMessage}) => {
const fetchData = async (replicaPort) => {
try {
// Make API call
let port = parseInt(process.env.REACT_APP_DEFAULT_LOCAL_PORT) + replicaPort
const response = await fetch(process.env.REACT_APP_DEFAULT_LOCAL + String(port) + process.env.REACT_APP_SOCKET_URL_EP);
//let port = parseInt(process.env.REACT_APP_DEFAULT_LOCAL_PORT) + replicaPort
//const response = await fetch(process.env.REACT_APP_DEFAULT_LOCAL + String(port) + process.env.REACT_APP_SOCKET_URL_EP);
let port = parseInt(18501) + replicaPort
const response = await fetch("http://localhost:" + String(port) + "/consensus_data");
const newData = await response.json();
// Update state with new data
Object.keys(newData).map(key => {
Expand Down

0 comments on commit 767dda9

Please sign in to comment.