Fight with url of strapi content API

System Information
  • **Strapi Version3.5.2:
  • **Operating SystemMACOs:
  • **DatabaseSQL:
  • **Node Version10.22.0:
  • NPM Version:
  • Yarn Version:

Hello
i am new in Strapi, and i am fighting with content api, to request and get my content-types content !
This is probably simple, but i guess i missed something…

i build an admin interface first on my machine (in local)
the server is launched at http://localhost:1337/admin

i checked the roles & permissions “find” for all my content-types, to allow to get them with api.

in my website (which is totally separated), i make request to get content with axios
for example, to get content-type ‘header’ :
axios.get('http://localhost:1337/header').then(response => {...});

it works .

Then i a have deployed my strapi app on my own server (O2Switch)
The app is in a folder named ‘admin’ at the root of my website.

The url to see it is https://admin.davidanquetin.fr/admin

The admin panel works well.

But from my online website, which is now the url of api to get content ?
http://localhost:1337/header is not good (it works when i launch local server but it is not my goal !)
I do not understand how to configure it…
When i try to get content with axios.get('https://admin.davidanquetin.fr/admin/header') for example, it returns me html content but no json content.

thanks !

Hey @Dev_Anquetin,

Just like you did with your local server, you need to remove /admin from the url.
https://admin.davidanquetin.fr/header just works fine and gets you the JSON.
Everything under /admin will lead you to the admin panel.

hi @MattieBelt and thanks !!
there was so simple…

Haha yep, no problem. Good luck!