// for development, to use api-stub, just import it here and export it at the end; // it's a one-liner that switches from stub to actual api const api = {}; // not `/api` (relative to domain root) nor `//api` (results in https:///api/...) let prefix = "api"; let store = null; api.setStore = function(s){ store=s; }; api.post = function(url, body){ body = body || {}; body.session_id = store.getState().login.session_id; return m.request({ method: 'POST', url: prefix+url, body }); }; export default api;