1
votes

this is bugging me. I've downloaded and installed the sample app hxxxs://github.com/javiervd/laravel-ember-todo and everything seems to work fine when I do artisan serve and work with the site at localhost:8000, but if I just load the site through the app directory localhost/laravel-ember-todo/public the console log immediately tells me: hxxp://127.0.0.1/todos not found 404 error I've researched around but couldn't find a solution to my problem.

Thanks for shedding light on this issue.

If any more information is required I will be happy to provide.

UPDATE

I've updated todo.js with:

/* global App, Ember */

App.Todo = DS.Model.extend({
adapter: DS.RESTAdapter.reopen({
   namespace: 'laravel-ember-todo'
}),
text: DS.attr('string'),
isCompleted: DS.attr('boolean'),

todoDidChange: function () {
    Ember.run.once(this, function () {
        this.get('store').commit();
    });
}.observes('isCompleted', 'text')
});

but I'm still getting: Failed to load resource: the server responded with a status of 404 (Not Found) 127.0.0.1/laravel-ember-todo/todos In firebug it's saying the error is occurring at jquery.min.js (line 5).

1
What does your routes.php look like? - Darshan Sawardekar

1 Answers

0
votes

You need to point it to the laravel-ember-todo/public directory. So add /public to your namespace (I've not used Ember so I have no idea if that would work). Basically, the document root of your website is localhost, not localhost/laravel-ember-todo/public, so I'm guessing it's building URIs like /todos. The / makes it an absolute path and as such it's taken from the document root, which is just localhost.

This is why most people tend to use virtual hosts and have, for example, myapp.dev point to the location of their application's public directory.