Cant hit Wordpress.com endpoint
See original GitHub issueDescription
Cant hit wordpress.com endpoint. The plugin seems to be designed to assume the self-hosted api by appending /wp/v2
to the end of each call. The Wordpress hosted api uses this format https://public-api.wordpress.com/wp/v2/sites/staticsitegeneration.wordpress.com
Steps to reproduce
Set up the Wordpress plugin as normal but try to use a wordpress.com hosted site instead of a self-hosted one. You can use my demo url that is above.
Expected result
The expected result is fetching the data.
Actual result
Fails in develop startup with:
Error: Status 404 - https://public-api.wordpress.com/wp/v2/sites/staticsitegeneration.wordpress.com/wp/v2/types at WordPressSource.fetch (/Users/ayoung/experiments/gridsome/gridsome-wordpress-demo/node_modules/@gridsome/source-wordpress/index.js:171:15) at process._tickCallback (internal/process/next_tick.js:68:7)
Environment
Libs:
- gridsome version: 0.5.5
- @gridsome/cli version: 0.0.8
Browser:
- [ X ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
@technoSpino thanks for looking into this, that is helpful!
@hjvedvik @tomtev: do we want to update the source plugin documentation to reflect this, and/or provide a config option (and implementation) for allowing both self-hosted and wordpress.com?
I’ve fixed this bug updating the permalinks.
See this https://stackoverflow.com/questions/34670533/wordpress-rest-api-wp-api-404-error