Slim Framework two index.php file in two different folders

Connecting to the slim framework by angularjs like that

app.js

angular.module('myApp').factory('DatabaseFactory', function ($http) {
    return {
        getData: function () {
            return $http.get("app/api/getData");
        }

api/index.php

<?php
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();

$app->get('/getData', function() {
     //WORKS GREAT
});

and it work great but this

other.js

app.factory('UsersFactory', function($http) {
return{
    getProfile: function(){
        return $http.get("app/api/users/getUser");
    }
}

api/users/index.php

<?php
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();

$app->get('/getUser', function() {
     //DON'T WORK ERROR 404!!!
});

and return me error 404 file not found

FOLDERS:

api/Slim/other file

api/index.php

api/users/index.php

Please for help.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s