Browse Source

Merge branch 'frontend' into develop

pull/11/head
garritfra 5 years ago
parent
commit
17491190fb
  1. 1
      frontend/.env
  2. 3
      frontend/src/BlockList.tsx
  3. 2
      frontend/src/index.tsx

1
frontend/.env

@ -1 +0,0 @@
BACKEND_ADDRESS=http://localhost:42000/

3
frontend/src/BlockList.tsx

@ -4,7 +4,8 @@ import axios from "axios";
export default function BlockList() {
let [blocks, setBlocks] = useState([]);
let backendUrl: string = process.env.BACKEND_ADDRESS!;
let backendUrl: string =
process.env.BACKEND_ADDRESS || "http://localhost:42000/";
if (backendUrl === undefined) {
throw Error("backend address not specified in ENV variable");

2
frontend/src/index.tsx

@ -2,6 +2,4 @@ import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
require("dotenv").config();
ReactDOM.render(<App />, document.getElementById("root"));

Loading…
Cancel
Save