From 5aee3f3a29e175968d1d4e05fa920eaecccc4a2e Mon Sep 17 00:00:00 2001 From: Thomas Evans Date: Thu, 4 Aug 2022 02:57:23 -0500 Subject: [PATCH] Updated PHP Config for API Calls. --- nginx/pispotter.conf | 10 +++++++++- src/App.jsx | 24 ++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/nginx/pispotter.conf b/nginx/pispotter.conf index 4e395b7..010c0b2 100644 --- a/nginx/pispotter.conf +++ b/nginx/pispotter.conf @@ -1,4 +1,12 @@ location ^~ /pispotter { alias /var/www/pispotter; - try_files $uri $uri/ /pispotter/index.html; + try_files $uri $uri/ /pispotter/index.html; + + location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; + fastcgi_param SCRIPT_FILENAME $request_filename; + + } } diff --git a/src/App.jsx b/src/App.jsx index c5a41f7..c62ae4a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,6 +1,11 @@ import { React, Fragment, useState } from "react"; import { Dialog, Transition } from "@headlessui/react"; -import { HomeIcon, MenuAlt2Icon, XIcon } from "@heroicons/react/outline"; +import { + HomeIcon, + MenuAlt2Icon, + SearchIcon, + XIcon, +} from "@heroicons/react/outline"; import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; import Spotter from "./pages/spotter"; import { ApiProvider } from "./contexts/ApiContext"; @@ -13,6 +18,12 @@ function classNames(...classes) { return classes.filter(Boolean).join(" "); } +const defaultURL = () => { + if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") + return "http://192.168.1.184"; + return ""; +}; + const App = () => { const [sidebarOpen, setSidebarOpen] = useState(false); @@ -21,7 +32,7 @@ const App = () => { return ( <> - +
{
{/* Sidebar component, swap this element with another sidebar if you like */}
-
- Blah. +
+ + Pi-Spotter