You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ConsEco/Sources/API/index.php

31 lines
685 B

<?php
require 'vendor/autoload.php';
$router = new AltoRouter();
$router->setBasePath('/~vincent/ConsEco/Sources/API');
$router->map( 'GET', '/', function(){
echo 'Hello World';
});
$router->map('GET','/Inscrit', function(){
require(__DIR__.'/api/inscrit/read.php');
});
$router->map('GET','/Inscrit/[*:mail]', function($mail){
require(__DIR__.'/api/inscrit/readFromMail.php');
});
$match = $router->match();
if($match!=null) {
if( is_array($match) && is_callable( $match['target'] ) && isset($match['params']) ) {
call_user_func_array( $match['target'], $match['params']);
}else{
$match['target']();
}
}
else {
echo 'ERROR 404';
}
?>