diff --git a/canapGEST/API/public/FA.png b/canapGEST/API/public/FA.png new file mode 100644 index 0000000000000000000000000000000000000000..c11443a97f397511cf52fadcceb45a72825fd2c7 Binary files /dev/null and b/canapGEST/API/public/FA.png differ diff --git a/canapGEST/API/public/epfl-logo.svg b/canapGEST/API/public/epfl-logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..5ebfd81e52886e451cd32659c7a97e317f314000 --- /dev/null +++ b/canapGEST/API/public/epfl-logo.svg @@ -0,0 +1 @@ +<svg id="logo_epfl_2019" data-name="logo epfl 2019" xmlns="http://www.w3.org/2000/svg" width="182.4" height="53" viewBox="0 0 182.4 53"><defs><style>.cls-1{fill:red;}</style></defs><title>epfl-logo-new</title><polygon class="cls-1" points="0 21.6 11.43 21.6 11.43 9.8 38.34 9.8 38.34 0 0 0 0 21.6"/><polygon class="cls-1" points="0 53 38.34 53 38.34 43.2 11.43 43.2 11.43 31.4 0 31.4 0 53"/><rect class="cls-1" x="11.43" y="21.6" width="24.61" height="9.8"/><path class="cls-1" d="M86,4.87a16.12,16.12,0,0,0-5.68-3.53A23.76,23.76,0,0,0,71.82,0H48.14V53H59.57V31.4H71.82a23.76,23.76,0,0,0,8.46-1.34A16.12,16.12,0,0,0,86,26.53a13.43,13.43,0,0,0,3.19-5,17.38,17.38,0,0,0,0-11.62A13.52,13.52,0,0,0,86,4.87ZM78,18.73a5.7,5.7,0,0,1-2.26,1.8,11.33,11.33,0,0,1-3.27.85,32,32,0,0,1-3.86.22H59.57V9.8h9.05a32,32,0,0,1,3.86.22,11,11,0,0,1,3.27.86A5.59,5.59,0,0,1,78,12.67a5,5,0,0,1,.86,3A5,5,0,0,1,78,18.73Z"/><polygon class="cls-1" points="155.47 43.2 155.47 0 144.04 0 144.04 53 182.38 53 182.38 43.2 155.47 43.2"/><polygon class="cls-1" points="97.42 21.6 108.85 21.6 108.85 9.8 135.76 9.8 135.76 0 97.42 0 97.42 21.6"/><rect class="cls-1" x="97.42" y="31.4" width="11.43" height="21.6"/><rect class="cls-1" x="108.85" y="21.6" width="24.61" height="9.8"/></svg> diff --git a/canapGEST/API/public/test.php b/canapGEST/API/public/test.php new file mode 100644 index 0000000000000000000000000000000000000000..bc8138041796b2f356c7753ed449ac46b732c256 --- /dev/null +++ b/canapGEST/API/public/test.php @@ -0,0 +1,8 @@ +<?php + +if ($_GET['phpinfo']) { + phpinfo(); +} else { + echo "Nothing here"; +} + diff --git a/canapGEST/API/resources/views/welcome.php b/canapGEST/API/resources/views/welcome.php new file mode 100644 index 0000000000000000000000000000000000000000..4ede24cb5c6885566884d8047de483847a3b4f04 --- /dev/null +++ b/canapGEST/API/resources/views/welcome.php @@ -0,0 +1,29 @@ +<!-- View stored in resources/views/welcome.php --> +<html> + <head> + <title>CANAP API</title> + <style> + header img { + vertical-align: middle; + } + header .logo-epfl img { + height: 30px + } + header .logo-fa img { + height: 50px + } + </style> + </head> + <body> + <header> + <a class="logo logo-epfl"> + <img src="/epfl-logo.svg" alt="Logo EPFL, Ɖcole polytechnique fƩdƩrale de Lausanne" class="img-fluid"> + </a> + <a class="logo logo-fa"> + <img src="/FA.png" alt="Logo FA, Formation Apprentis EPFL" class="img-fluid"> + </a> + </header> + <h1>CANAP API</h1> + </body> +</html> + diff --git a/canapGEST/API/routes/web.php b/canapGEST/API/routes/web.php index 95a48946dcde89fd427e83255ce06c5cf6f4c334..31524c33e798f26fbe68bf53c031d00832807a63 100644 --- a/canapGEST/API/routes/web.php +++ b/canapGEST/API/routes/web.php @@ -1,4 +1,24 @@ <?php + +// Add a basic home page to the API, without auth +$router->get('/', function() { + return view('welcome'); +}); + +// Comfort route to test DB and PDO +// https://github.com/laravel/framework/issues/30737 +$router->get('/test-db', function() { + try { + DB::connection()->getPdo(); + } catch (\Exception $e) { + die("<pre>Could not connect to the database. Please check your configuration. error:" . $e ); + } +}); + +// Comfort route to test the status list +$router->get('/test-status', 'StatusController@getAvailableStatus'); + + $router->get('api/auth/login', 'AuthController@login'); $router->get('api/auth/tequilareturn', 'AuthController@tequilareturn'); // logout