Added backend and refactored frond-end to support it.
* Removed unecesery home page * Added PHP Api that provides auth and replaces the json-server for data storage * Added support for alternate geocode-api * Added registration page
This commit is contained in:
3
api/config/auth.php
Normal file
3
api/config/auth.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$AllowUserRegistration = true;
|
||||
13
api/config/db.php.example
Normal file
13
api/config/db.php.example
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$host = 'localhost';
|
||||
$dbname = 'ttapi';
|
||||
$username = 'ttapi';
|
||||
$password = '';
|
||||
|
||||
try {
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
echo "Connection failed: " . $e->getMessage();
|
||||
}
|
||||
5
api/config/geocode.php.example
Normal file
5
api/config/geocode.php.example
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$geocodeType = 'bigdatacloud'; //bigdatacloud or photon
|
||||
$geocodeApikey = false; //false to disable or enter api key between quotes to enable auth for the api call (key is send as 'X-Api-Key' header )
|
||||
$geocodeApiurl = 'https://api.bigdatacloud.net/data/reverse-geocode-client'; //Set url of the geoip Api
|
||||
8
api/config/headers.php
Normal file
8
api/config/headers.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
//Use for Dev environment
|
||||
/*
|
||||
header("Access-Control-Allow-Origin: http://localhost:5173");
|
||||
header('Access-Control-Allow-Credentials: true');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS,DELETE');
|
||||
*/
|
||||
Reference in New Issue
Block a user