Directus JS SDK adds an extra slash to the API link

  directus, javascript

I wrote this code to fetch some data using the JS SDK :

directus.items('configuration').read<TConfiguration>({ single: true });

This will generate a get query to

/items/configuration/?single=true

which returns an 404 Not Found error.

The right end point is without a slash ‘/’ :

/items/configuration?single=true

I checked the documentation and I didn’t find a way to remove this extra slash. And I don’t want to use Apache or htaccess to ignore it.

Is there a native Directus option to remove it ?

Source: Ask Javascript Questions

2 thoughts on - Directus JS SDK adds an extra slash to the API link

LEAVE A COMMENT