0

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

jason
  • 81
  • 1
  • 6
  • Did you deploy your code to http://test.ap01.aws.af.cm/app/api/? Does it work on localhost? – Odi Jan 14 '13 at 23:57
  • hi Odi, yes it works on localhost. My rootURl for localhost is http://localhost/test/api. the main url when accessing the site does not include the /app/api in the url, the slim framework along with the index.php is just in /app/api – jason Jan 15 '13 at 00:22

1 Answers1

0

I think I found out the cause of the error, I included /app in the url which should not be. My mistake on this one. Thought I should include the whole URL when I checked the app directory.

Thanks!

jason
  • 81
  • 1
  • 6