Slim フレームワークを使用して Appfog で REST アプリケーションをセットアップしようとしています。これは、次のリンクの Coenrats によるチュートリアルに基づいています: http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/
フレームワークの新しいバージョンを使用しただけです。フォルダ構成は以下の通り
app
--> api
----> .htaccess
----> index.php
----> Slim Framework フォルダー
--> js
----> jquery.js
----> main.js
-- > css
----> style.css
--> index.html
これが私がスリムになる方法のコードです
// load required files
require 'Slim/Slim.php';
// register Slim auto-loader
\Slim\Slim::registerAutoloader();
// initialize app
$app = new \Slim\Slim();
これが私の .htaccess コードです:
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]
私はRESTを行っているので、次のチュートリアルに従ってrootURLも設定しました:
var rootURL = "http://test.ap01.aws.af.cm/app/api/";
アプリケーションを実行すると、get メソッドを呼び出してデータベース内のすべてのデータを取得していますが、コンソールに次のエラーが表示されます。
GET http://test.ap01.aws.af.cm/app/api/ 404 (見つかりません)
私は何かが欠けている可能性がありますか?
前もって感謝します。
乾杯!ジェイソン