Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Consider handling trailing forwardslash for apiURL #69

Closed
ghost opened this issue Jun 24, 2019 · 2 comments
Closed

Consider handling trailing forwardslash for apiURL #69

ghost opened this issue Jun 24, 2019 · 2 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jun 24, 2019

Hello,

I was a pit perplexed today trying to connect to my remote server. It wasn't until looking at source did I realize that a slash is manually added in fetch.js and updated my config.

Having looked through the tutorial previously, I don't remember this being documented. Maybe it could be handled or documentation added stating not to add a slash. Happy to submit a PR either way.

@davidkartuzinski
Copy link
Contributor

@Skraelingjar Thank you very much for this comment. To clarify, you are referring to the URL for apiURL?

    {
      resolve: 'gatsby-source-strapi',
      options: {
        apiURL: 'http://localhost:1337',
        contentTypes: [ // List of the Content Types you want to be able to request from Gatsby.
          'article',
          'user'
        ],
        queryLimit: 1000,
      },

Several people were tripped up with this, and I believe I address it in the video. I have updated the
blog post tutorial.

Does this clarify it for you?


NOTE: Please understand that the apiURL:, e.g. http://localhost:1337 does NOT have a trailing slash. This will create issues, as a slash is added by other code in the plugin.


Thanks again, and we welcome all thoughts and help like this!

@davidkartuzinski davidkartuzinski self-assigned this Jun 25, 2019
@ghost
Copy link
Author

ghost commented Jun 25, 2019

Ahh, I didn't watch the video. Yes, I am referring to the URL for apiURL.
Thanks for adding it to the blog post. Hopefully, nobody else will make the same mistake I did.

@ghost ghost closed this as completed Jun 25, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant