I'm trying to make this simple tutorial work on my server but I'm facing a problem which I don't know how to solve.
Suggested directory api is created and only index.php and .htaccess files.
Content of .htaccess file is the same as in tutorial but index.php is altered so it looks like this:
<?php
$app = new Phalcon\Mvc\Micro();
$app->get('/api/robots', function() use ($app){
$response->setJsonContent(array('status' => 'OK', 'messages' => 'This works'));
return $response;
});
$app->handle();
?>
But when I try to send GET request to address:
https://SERVER_IP_ADDR/test-api/api/robots
using hurl.it and I get the following response:
404 Not Found 297 bytes 175 ms
HEADERS
Connection: close
Content-Length: 297
Content-Type: text/html; charset=iso-8859-1
Date: Fri, 27 Mar 2015 17:44:46 GMT
Server: Apache/2.2.15 (CentOS)
BODY view raw
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL /test-api/api/robots was not found on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at SERVER_IP_ADDRESS Port 80</address>
</body>
</html>
I must note that my apache configuration file is a default one because I assume that the catch lies somwhere here.