Wildhoney / Magento-on-Angular

Angular.js application using Magento as the backend API
361 stars 120 forks source link

Issue in accessing api/public/products #54

Closed hiteshvanjani closed 10 years ago

hiteshvanjani commented 10 years ago

Hi I am getting error : "The requested URL /Magento-on-Angular/api/public/products was not found on this server." Everything is installed properly, on accessing /Magento-on-Angular/store, data is not loading into angularjs

capture

Wildhoney commented 10 years ago

You're using Apache? I think the issue is going to be with your mod_rewrite being disabled: http://stackoverflow.com/questions/16912134/laravel-4-htaccess-not-rewriting-urls

hiteshvanjani commented 10 years ago

Thanks, but now a new error occurs while accessing the api/public/products

Call to undefined method Illuminate\Foundation\Application::redirectIfTrailingSlash() in C:\wamp\www\ecommerce\api\bootstrap\start.php on line 16

Wildhoney commented 10 years ago

Do these solutions help? https://github.com/laravel/framework/issues/1311

hiteshvanjani commented 10 years ago

Not yet, I am planning to develop an ecommerce project using MOA. Is there any discussion forum or stackoverflow group for this project, I have been facing lot of issues in setting up project. Also, It would be great to check any live ecommerce projects running using MOA.

hiteshvanjani commented 10 years ago

@Wildhoney , redirectIfTrailingSlash() method is called in start.php. This method is not included Laravel Framework 4.1. (source : from discussion at laravel/framework#1311 ). can you suggest any solution for it ?

Wildhoney commented 10 years ago

Moa is currently running on 4.0 though; I'll open a separate ticket to upgrade Laravel to 4.1.

I'm currently doing the same in developing Moa for use on a high-traffic website. When you get a chance to develop it further, if you could keep it generic and commit it to Moa, it would be greatly appreciated! @gabrieleravanelli is supposed to be helping with the implementation, but he is quite useless. I'm more than happy to add you as a contributor if this is something that would interest you?

I've ran a couple of stress tests/benchmarks on Moa, which has been my focus for last week -- predominantly in https://github.com/Wildhoney/Snapshot.js/commit/f20df10339b67bc4aad5b0584e98da645ddfcb99 with the nextTick for allowing other clients to complete their requests, as the creation of dimensions in Crossfilter is the most expensive part. Next week I plan on implementing Node.js cluster to delegate to other CPU cores. However currently most requests are completed in <5ms with 1,000 concurrent users. For Node.js monitoring you could use something like NewRelic.

hiteshvanjani commented 10 years ago

@Wildhoney , composer.json has : "laravel/framework": "4.1.*", If MOA is using Laravel 4.0, I suggest, until Laravel is upgraded to 4.1, composer.json should contain laravel/framework": "4.0".

I am still having problem in connecting from API code to Magento. Any document which could help me to understand , how API code implemented using Laravel is interacting with Magento system.

I would like to develop more on this project, but first I need to understand complete system. I am also interested to develop nodejs API server instead of Laravel framework. Can you guide, how to start with it ?

aonic commented 10 years ago

I am also interested in building micro-sites based out of a bigger Magento site using this project, and will be happy improve docs/contribute as I use it more.

@hiteshvanjani the Laravel app is using the Magento includes and a Mage::app() instance to access Magento data. The only way to move the API backend to nodejs (and eliminate the PHP code in this project) would be to call the Magento SOAP API from nodejs directly. I find the Magento SOAP API to be very slow and it would be hard to cache things.

It makes sense to implement the Magento connector API by using Laravel as you will have more flexibility in implementing caching logic and custom behavior. Doing anything major in Magento is riddled with XML and abstractions on top of abstractions.

I would like to develop more on this project, but first I need to understand complete system

The Laravel code right now is very small, it should be pretty easy to browse through the app/controllers folder to figure out what's going. You can see the Mage:app() bootstrap call here: https://github.com/Wildhoney/Magento-on-Angular/blob/master/api/app/controllers/MageController.php

Wildhoney commented 10 years ago

@aonic Thanks for the great response!

@hiteshvanjani I've upgraded Mao to Laravel 4.1. I've also run through the steps for the installation, and updated the README accordingly.

hiteshvanjani commented 10 years ago

@Wildhoney , thanks for quick action.