404 when new function is added
emoran opened this issue · comments
Edgar Moran commented
Hi,
I'm having problems adding a new function in my code, the test or main is working good but when I created a new GET function and test it with postman I'm getting 404 error. This is how my function looks like:
/**
* Get all customers functions
*
* @url GET /customers/$id
*/
public function getCustomers{
return "customer information working...";
}
It happens also if I use a POST method. There's something additional I need to to or implement?
Thanks in advance,
Milan commented
try adding
$server = new Jacwright\RestServer\RestServer('debug');
$server->refreshCache(); // <----- this line here
Edgar Moran commented
Thanks @designstorming still not working, root path is working great, but this new one I can see it exposed.
Milan commented
public function getCustomers{
return "customer information working...";
}
Have you added parentheses?
public function getCustomers($id){
return "customer information working...";
}
Also check if .htaccess is present as @jacwright described
Edgar Moran commented
Thanks again @designstorming I just modified my httpd.config adding:
<Directory "my_directory_where_my_project_is_hosted">
AllowOverride All
Order allow,deny
allow from all
</Directory>
And now is working fine,