I'm trying to setup a REST application in Appfog using Slim framework. This was based on a tutorial by Coenrats in this link: http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/
only I used a newer version of the framework. Folder structure are as follows
app
--> api
----> .htaccess
----> index.php
----> Slim framework folder
--> js
----> jquery.js
----> main.js
--> css
----> styles.css
--> index.html
Here's the code on how I Slim
// load required files
require 'Slim/Slim.php';
// register Slim auto-loader
\Slim\Slim::registerAutoloader();
// initialize app
$app = new \Slim\Slim();
Here's my .htaccess code:
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
Since I'm doing REST, I have setup a rootURL also as per the tutorial which is:
var rootURL = "http://test.ap01.aws.af.cm/app/api/";
When I run the application, I'm calling a get method to fetch all the data in the database but this error shows up in my console:
GET http://test.ap01.aws.af.cm/app/api/ 404 (Not Found)
Could I be missing something?
Thanks in advance.
Cheers! Jason