2014-10-30 21:44:22 +01:00
|
|
|
import DS from "ember-data";
|
|
|
|
|
2014-07-06 17:37:54 +02:00
|
|
|
export default DS.RESTAdapter.extend({
|
2014-07-06 19:22:38 +02:00
|
|
|
// set namespace to api.php in same subdirectory
|
|
|
|
namespace:
|
|
|
|
window.location.pathname
|
|
|
|
// remove index.html if it's there
|
|
|
|
.replace(/index.html$/, '')
|
2014-11-26 13:15:05 +01:00
|
|
|
// remove tests prefix which are added if tests are running
|
|
|
|
.replace(/tests/, '')
|
2014-07-06 19:22:38 +02:00
|
|
|
// remove leading and trailing slash
|
|
|
|
.replace(/\/$/, '')
|
|
|
|
// add api.php
|
2014-11-02 23:43:34 +01:00
|
|
|
.concat('/api.php?')
|
2014-07-06 19:22:38 +02:00
|
|
|
// remove leading slash
|
|
|
|
.replace(/^\//g, '')
|
2014-07-06 17:37:54 +02:00
|
|
|
});
|