DNS Add service serviceHomeDirPath

So, I think I’m close to having DNS Add service working, as a first attempt at authorised API but what I expected of serviceHomeDirPath is giving a

*ERRNO: -1502* FfiError::PathNotFound

The authorisation looks to be working, it just looks to be stuck finding the path.

The example in the docs https://api.safedev.org/dns/add-service.html
suggests “serviceHomeDirPath”: “/websites/test”
but I wondered that would be now “serviceHomeDirPath”: “/public/example” where I have a folder existing.

The error seems to spawn from trying to navigate to /public

Traversing to dir with name: public
FFI cross-boundary error propagation:
*ERRNO: -1502* FfiError::PathNotFound

So, having tried simply also “serviceHomeDirPath”: “/example” I’m stumped wondering why it can’t find /public or the existing /public/example to then map the suggested new service to.

Example of the PUT I’m using is:

put_heads  {"Connection": "close", "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImhXRkR4Q0JsVkxqVVFUL2hialZTTjIzQWpuN2RMNVhnUE9wMko2NWt3bjg9IiwiaWF0IjoxNDc3MjQ2MTM4fQ.NFa0uJqyQvnIK9H_IJqi6z0VdkQzBVLp-rJfU_mqGBc", "Content-Type": "application/json"}

put_body  AddServiceBody { longName: "testtest", serviceName: "service", rootPath: "drive", serviceHomeDirPath: "/public/example/" }

Add service: 400 Bad Request

What am I missing?

2 Likes

yes, the example assumes that /websites/test already exists (in SAFE Drive).

Using the Get directory endpoint, are you able to successfully fetch the directory you want to add as a service?

Did you previously create that folder (/public) using the Create directory endpoint? Or are trying to access the /public folder created by SAFE Demo App? That folder is created in the app root directory of SAFE Demo App, not in SAFE Drive, so you wouldn’t be able to access it unless you impersonate SAFE Demo App.

2 Likes

Yes… so, that makes sense. I’ll try again then understanding what is in drive and what is in app.

1 Like