cdnjs / new-website

🖥 cdnjs.com website
https://cdnjs.com
ISC License
451 stars 212 forks source link

[Website] Update API docs #335

Closed Glennmen closed 4 years ago

Glennmen commented 4 years ago

Rewrote unclear documentation for the assets field.

The API docs might have been unclear for some people, I did a couple small changes that hopefully will avoid confusion. Cause of these changes: https://cdnjs.discourse.group/t/asset-in-api-is-not-loading/291

I also noticed different API docs here (https://api.cdnjs.com/) but couldn't find where I could update this.

MattIPv4 commented 4 years ago

api.cdnjs.com is the same content as cdnjs.com/api - @xtuc do you have any idea why its badly rendering the content from cdnjs.com/api instead of redirecting?

Glennmen commented 4 years ago

@MattIPv4 I don't think that is correct, they are not from the same content. The change you added some time ago is not visible in api.cdnjs.com

From cdnjs.com/api image

From api.cdnjs.com image

MattIPv4 commented 4 years ago

I wonder if there's some odd caching going on there, Sven should be able to dig into this a bit better -- there is nothing in the app that'd serve this content and it does indeed appear to be a version of cdnjs.com/api

xtuc commented 4 years ago

@MattIPv4 I'm not sure what's wrong with the redirect. The setup for api.cdnjs.com is currently complicated: api.cdnjs.com/* has a worker running which fetches from cdnjs-api.speedcf.com and cdnjs-api.speedcf.com is a CNAME to the Heroku app domain. I should fix the setup, which might fix the redirect somehow

MattIPv4 commented 4 years ago

Interesting -- I wonder if the worker is parsing the redirect and serving the content from the redirect for some weird reason?

MattIPv4 commented 4 years ago

Anyway, this PR can be shipped. We can dig into this further and discuss on Slack.