Fix broken backend connection in prod build (fix #151) #152

Merged
cami merged 3 commits from infra/backendconnection into main 2021-07-13 18:06:07 +00:00
7 changed files with 13 additions and 15 deletions

View file

@ -8,8 +8,6 @@ services:
backend-prod: backend-prod:
image: caminsha/bt-backend image: caminsha/bt-backend
container_name: backend_bt container_name: backend_bt
ports:
- 5000:5000
environment: environment:
DEBUG: "no" DEBUG: "no"
PORT: 5000 PORT: 5000

View file

@ -1,15 +1,19 @@
server { server {
listen 80; listen 80;
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
# to redirect all the requests to index.html, # to redirect all the requests to index.html,
# useful when you are using react-router # useful when you are using react-router
try_files $uri /index.html; try_files $uri /index.html;
proxy_pass http://localhost:5000
} }
location /api {
# include uwsgi_params;
# uwsgi_pass http://backend-prod:5000;
proxy_pass http://backend-prod:5000;
}
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
} }

View file

@ -1,10 +1,9 @@
import React, { useEffect } from "react"; import React, { useEffect, useState} from "react";
import "../../App.css"; import "../../App.css";
import Footer from "../../Footer"; import Footer from "../../Footer";
import { Logger } from "@behametrics/logger-web"; import { Logger } from "@behametrics/logger-web";
import { useAuth } from "../../auth/AuthProvider"; import { useAuth } from "../../auth/AuthProvider";
import InputField from "../InputField"; import InputField from "../InputField";
import { useState } from "react/cjs/react.development";
import SubmitField from "../SubmitField"; import SubmitField from "../SubmitField";
export default function BehaviorNormal() { export default function BehaviorNormal() {

View file

@ -1,5 +1,4 @@
import React from "react"; import React, {useState} from "react";
import { useState } from "react/cjs/react.development";
import "../../App.css"; import "../../App.css";
import Footer from "../../Footer"; import Footer from "../../Footer";
import InputField from "../InputField"; import InputField from "../InputField";

View file

@ -1,5 +1,4 @@
import React from "react"; import React, {useState} from "react";
import { useState } from "react/cjs/react.development";
import "../../App.css"; import "../../App.css";
import Footer from "../../Footer"; import Footer from "../../Footer";
import InputField from "../InputField"; import InputField from "../InputField";

View file

@ -1,4 +1,4 @@
import { useEffect, useState } from "react/cjs/react.development"; import { useEffect, useState } from "react";
import { authFetch } from "../../auth/AuthProvider.js"; import { authFetch } from "../../auth/AuthProvider.js";
function Secret() { function Secret() {

View file

@ -1,5 +1,4 @@
import React from "react"; import React, {useState} from "react";
import { useState } from "react/cjs/react.development";
import "../../App.css"; import "../../App.css";
import "../Input.css"; import "../Input.css";
import Footer from "../../Footer"; import Footer from "../../Footer";