decide.nolog.cz/app/adapters/application.js
2014-07-06 17:37:54 +02:00

12 lines
433 B
JavaScript

export default DS.RESTAdapter.extend({
// set namespace to api.php in same subdirectory
namespace: window.location.pathname
// remove index.html if it's there
.replace(/index.html$/, '')
// remove leading and trailing slash
.replace(/\/$/, '')
// add api.php
.concat('/api.php?')
// remove leading slash
.replace(/^\//g, '')
});