vendredi 1 avril 2016

Nginx not getting file available on route through Ember.js

Works on local and github pages but with nginx. Even on nginx I can properly get the json file from the browser, just not within the ember app on nginx.

export default Ember.Route.extend({
  model: function () {
      return $.getJSON('data/contributors.json')
  }
})

Results in this error only on Nginx:

server.js:76 Mirage: Your Ember app tried to GET 'data/contributors.json', but there was no route defined to handle this request. Define a route that matches this path in your mirage/config.js file. Did you forget to add your namespace?

location config on nginx:

location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
            # Uncomment to enable naxsi on this location
            # include /etc/nginx/naxsi.rules
            try_files $uri /index.html;

    }

    location /data {
            try_files $uri /contributors.json
    }

Any help in resolving the error is much appreciated.




Aucun commentaire:

Enregistrer un commentaire