Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit documentation of asset URLs #48

Closed
fulldecent opened this issue Aug 20, 2014 · 7 comments
Closed

Explicit documentation of asset URLs #48

fulldecent opened this issue Aug 20, 2014 · 7 comments

Comments

@fulldecent
Copy link

Please consider:

http://api.jsdelivr.com/v1/bootstrap/libraries?name=*bootstrap

The result shows project name is twitter-bootstrap, version is 3.2.0 and one asset is css/bootstrap.min.css. However, the actual asset hosted on the CDN is located at this scheme-relative URL:

//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css

Please provide a reliable and documented way for API users to determine the full scheme-relative CDN asset URL with the returned information. Presently it is necessary to know the CDN's base URL and, in this case, the canonical name for twitter-bootstrap.

@tomByrer
Copy link
Contributor

@bebraw It would be easier if all APIs' folder names matched their project name.
jsDelivr also serves as "bootstrap". Not sure how the "twitter-" got in there, but IIRC you also handle the BootstrapCDN...
For the API, perhaps an alias or 'normname' field can be "twitter-boostrap" to help it not be confused with other 'bootstraps'.

@fulldecent
Copy link
Author

Having folder names match projects would be helpful and solve half the problem. For the other half of the problem, I would like, for example, this URL:

http://api.jsdelivr.com/v1/jsdelivr/libraries

To return this data:

[
    {
        "name":"jsdelivr",
        "assetBase":"//cdn.jsdelivr.net"
        "urlStructure":"ASSETBASE/NAME/VERSION/FILE"
    },
    {
        "name":"google",
        "assetBase":"//ajax.googleapis.com/ajax/libs"
        "urlStructure":"ASSETBASE/NAME/VERSION/FILE"
    },
    {
        "name":"jsdelivr",
        "assetBase":"//cdnjs.cloudflare.com/ajax/libs"
        "urlStructure":"ASSETBASE/NAME/VERSION/FILE"
    },
    {
        "name":"bootstrap",
        "assetBase":"//maxcdn.bootstrapcdn.com"
        "urlStructure":"ASSETBASE/NAME/VERSION/FILE"
    },
    {
        "name":"jquery",
        "assetBase":"https://code.jquery.com"
        "urlStructure":"ASSETBASE/FILE"
    }
]

Does anyone else like this approach?

@tomByrer
Copy link
Contributor

Does anyone else like this approach?

I'm not the maintainer, but I do not think it should be part of the the API's output.
Your information is very helpful, but belongs in a WiKi entry or separate project IMHO. It is up to the programmer who consumes the data to format how they want the information for their particular use-case.

@fulldecent
Copy link
Author

I have moved the project renaming to a separate issue, #50

This issue is now only concerned with including the above JSON information in the project, which is necessary if data consumers are interested to translate the output of this API into usable URL addresses.

@fulldecent
Copy link
Author

Drunk. Closing issue, will reopen as smaller, more specific issue.

@fulldecent
Copy link
Author

Discussion continued at #55

@fulldecent
Copy link
Author

related: http://tools.ietf.org/html/rfc6570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants