auf hope-fly geaendert
This commit is contained in:
@ -42,5 +42,6 @@
|
|||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"homepage": "http://localhost/dog"
|
"homepage____": "http://localhost:3000/dog",
|
||||||
|
"homepage": "https://hope-fly.de/dog"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,8 @@ class Database
|
|||||||
{
|
{
|
||||||
|
|
||||||
// CHANGE THE DB INFO ACCORDING TO YOUR DATABASE
|
// CHANGE THE DB INFO ACCORDING TO YOUR DATABASE
|
||||||
private $db_host = 'localhost';
|
//private $db_host = 'localhost';
|
||||||
//private $db_host = '10.35.232.188:3306';
|
private $db_host = '10.35.232.188:3306';
|
||||||
private $db_name = 'k200835_dog';
|
private $db_name = 'k200835_dog';
|
||||||
private $db_username = 'k200835_user_dog';
|
private $db_username = 'k200835_user_dog';
|
||||||
private $db_password = 'X0pEiBsXN3RLazGhQVvP';
|
private $db_password = 'X0pEiBsXN3RLazGhQVvP';
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>Hund gefunden?</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"short_name": "React App",
|
"short_name": "Hund gefunden?",
|
||||||
"name": "Create React App Sample",
|
"name": "--- Hund gefunden? ---",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
@ -8,7 +8,7 @@
|
|||||||
"type": "image/x-icon"
|
"type": "image/x-icon"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"start_url": "./dog",
|
"start_url": ".",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"theme_color": "#000000",
|
"theme_color": "#000000",
|
||||||
"background_color": "#ffffff"
|
"background_color": "#ffffff"
|
||||||
|
|||||||
@ -20,16 +20,14 @@ function App()
|
|||||||
<BrowserRouter basename='/dog'>
|
<BrowserRouter basename='/dog'>
|
||||||
<Routes>
|
<Routes>
|
||||||
{ user && <Route path="/" element={<Home/>} /> }
|
{ user && <Route path="/" element={<Home/>} /> }
|
||||||
{user && (
|
{ (
|
||||||
<>
|
<>
|
||||||
<Route path="/:qr_id" element={<Dog/>} />
|
<Route path="/:qr_id" element={<Dog/>} />
|
||||||
<Route path="/login" element={<Login/>} />
|
<Route path="/login" element={<Login/>} />
|
||||||
<Route path="/reg" element={<Register/>} />
|
<Route path="/reg" element={<Register/>} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{/* <Route path="*" element={<Navigate to={user ? '/':'/login'} />} /> */}
|
<Route path="*" element={<Navigate to={user ? '/':'/login'} />} />
|
||||||
<Route path="/login" element={<Login/>} />
|
|
||||||
<Route path="/reg" element={<Register/>} />
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -48,7 +48,8 @@ export type UserCtxT =
|
|||||||
export const UserCtx = createContext<UserCtxT | null>(null);
|
export const UserCtx = createContext<UserCtxT | null>(null);
|
||||||
|
|
||||||
export const Axios = axios.create({
|
export const Axios = axios.create({
|
||||||
baseURL: 'http://localhost/dog/php-dog/',
|
// baseURL: 'http://localhost/dog/php-dog/',
|
||||||
|
baseURL: 'https://hope-fly.de/dog/php-dog/',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$routes =
|
|
||||||
[
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
route('/', function () {
|
|
||||||
echo "Home Page";
|
|
||||||
});
|
|
||||||
|
|
||||||
route('/login', function () {
|
|
||||||
echo "Login Page";
|
|
||||||
});
|
|
||||||
|
|
||||||
route('/about-us', function () {
|
|
||||||
echo "About Us";
|
|
||||||
});
|
|
||||||
|
|
||||||
route('/404', function () {
|
|
||||||
echo "Page not found";
|
|
||||||
});
|
|
||||||
|
|
||||||
function route(string $path, callable $callback) {
|
|
||||||
global $routes;
|
|
||||||
$routes[$path] = $callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
|
|
||||||
function run() {
|
|
||||||
global $routes;
|
|
||||||
$uri = $_SERVER['REQUEST_URI'];
|
|
||||||
$found = false;
|
|
||||||
foreach ($routes as $path => $callback) {
|
|
||||||
if ($path !== $uri) continue;
|
|
||||||
|
|
||||||
$found = true;
|
|
||||||
$callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$found) {
|
|
||||||
$notFoundCallback = $routes['/404'];
|
|
||||||
$notFoundCallback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user