api_router - allow parameters as final path argument

This commit is contained in:
zotlabs 2019-03-04 20:11:43 -08:00
parent 8e50fecccc
commit 47001c3303

View File

@ -12,8 +12,16 @@ class Api_router {
}
static function find($path) {
if(array_key_exists($path,self::$routes))
if (array_key_exists($path,self::$routes)) {
return self::$routes[$path];
}
$with_params = dirname($path) . '/[id]';
if (array_key_exists($with_params,self::$routes)) {
return self::$routes[$with_params];
}
return null;
}