diff --git a/api/app/config/app.php b/api/app/config/app.php index d840daab..7bcca1ab 100644 --- a/api/app/config/app.php +++ b/api/app/config/app.php @@ -65,7 +65,7 @@ | */ - 'key' => 'llUcLdw8v9nl6uEzYDW5uwGRRRJkpIOV', + 'key' => 'llUcLdw8v9nl6kEzYDW5uwGRRRJkpIOV', /* |-------------------------------------------------------------------------- diff --git a/api/app/controllers/MageController.php b/api/app/controllers/MageController.php new file mode 100644 index 00000000..92f9de81 --- /dev/null +++ b/api/app/controllers/MageController.php @@ -0,0 +1,9 @@ +getCollection()->addAttributeToSelect('*'); + $collection = array(); + + foreach ($products as $product) { + + $collection[] = array( + 'name' => $product->getName(), + 'price' => $product->getPrice() + ); + + } + + return Response::json($collection); + + } + +} \ No newline at end of file diff --git a/api/app/routes.php b/api/app/routes.php index e2a75e25..675103ff 100644 --- a/api/app/routes.php +++ b/api/app/routes.php @@ -11,7 +11,10 @@ | */ -Route::get('/', function() -{ - return View::make('hello'); -}); \ No newline at end of file +//Route::get('/', 'HomeController@showWelcome'); +Route::get('/products/all', 'ProductsController@all'); +//Route::get('/', function() +//{ +//// return View::make('hello'); +// return Route::get('/', 'HomeController@showWelcome'); +//}); \ No newline at end of file diff --git a/api/app/tests/ExampleTest.php b/api/app/tests/ExampleTest.php deleted file mode 100644 index ead53e07..00000000 --- a/api/app/tests/ExampleTest.php +++ /dev/null @@ -1,17 +0,0 @@ -client->request('GET', '/'); - - $this->assertTrue($this->client->getResponse()->isOk()); - } - -} \ No newline at end of file diff --git a/api/app/tests/ProductsControllerTest.php b/api/app/tests/ProductsControllerTest.php new file mode 100644 index 00000000..b971c522 --- /dev/null +++ b/api/app/tests/ProductsControllerTest.php @@ -0,0 +1,11 @@ +client->request('GET', '/products/all'); + $this->assertTrue($this->client->getResponse()->isOk()); + } + +} \ No newline at end of file diff --git a/api/app/views/json.php b/api/app/views/json.php new file mode 100644 index 00000000..3febc7cf --- /dev/null +++ b/api/app/views/json.php @@ -0,0 +1 @@ +Ye... \ No newline at end of file diff --git a/api/composer.json b/api/composer.json index 0162a474..26892ba3 100644 --- a/api/composer.json +++ b/api/composer.json @@ -13,7 +13,10 @@ "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php" - ] + ], + "psr-0": { + "Mage": "../magento/app" + } }, "scripts": { "post-install-cmd": [