Skip to content

Instantly share code, notes, and snippets.

@daliborgogic
Last active December 12, 2018 17:48
Show Gist options
  • Save daliborgogic/503fe8b9231e3d56c352e4dc9afebf8c to your computer and use it in GitHub Desktop.
Save daliborgogic/503fe8b9231e3d56c352e4dc9afebf8c to your computer and use it in GitHub Desktop.
let a = async (x = '') => await (await fetch(`https://api.github.com${x}`)).json()
await a()
// {
// "current_user_url": "/user",
await a('/user')
// "authorizations_url": "/authorizations",
// "code_search_url": "/search/code?q={query}{&page,per_page,sort,order}",
// "commit_search_url": "/search/commits?q={query}{&page,per_page,sort,order}",
// "emails_url": "/user/emails",
// "emojis_url": "/emojis",
// "events_url": "/events",
// "feeds_url": "/feeds",
// "followers_url": "/user/followers",
// "following_url": "/user/following{/target}",
// "gists_url": "/gists{/gist_id}",
// "hub_url": "/hub",
// "issue_search_url": "/search/issues?q={query}{&page,per_page,sort,order}",
// "issues_url": "/issues",
await a('/issues')
// "keys_url": "/user/keys",
// "notifications_url": "/notifications",
// "organization_repositories_url": "/orgs/{org}/repos{?type,page,per_page,sort}",
// "organization_url": "/orgs/{org}",
// "public_gists_url": "/gists/public",
// "rate_limit_url": "/rate_limit",
// "repository_url": "/repos/{owner}/{repo}",
// "repository_search_url": "/search/repositories?q={query}{&page,per_page,sort,order}",
// "current_user_repositories_url": "/user/repos{?type,page,per_page,sort}",
// "starred_url": "/user/starred{/owner}{/repo}",
// "starred_gists_url": "/gists/starred",
// "team_url": "/teams",
// "user_url": "/users/{user}",
await a('/users/daliborgogic')
// "user_organizations_url": "/user/orgs",
// "user_repositories_url": "/users/{user}/repos{?type,page,per_page,sort}",
// "user_search_url": "/search/users?q={query}{&page,per_page,sort,order}"
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment