Respect location pathname

Let's say we have a dat instance behind a reverse proxy which redirects requests at `http://host-tld/my-dat` to the respective dat. The `dat-editor` tries to communicate with the API at `/api`. This PR respects the given pathname so that the editor will talk with `http://host-tld/my-dat/api`.