This repository was archived by the owner on Jan 11, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-isomorphic-starterkit" ,
33 "description" : " Isomorphic starterkit with server-side React rendering." ,
4- "version" : " 2.3.2 " ,
4+ "version" : " 2.3.3 " ,
55 "license" : " BSD-3" ,
66 "repository" : {
77 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ server.route({
2424} ) ;
2525
2626/**
27- * Endpoint that proxies all requests to api.github.com
27+ * Endpoint that proxies all GitHub API requests to https:// api.github.com.
2828 */
2929server . route ( {
3030 method : "*" ,
3131 path : "/api/github/{path*}" ,
3232 handler : {
3333 proxy : {
3434 passThrough : true ,
35- mapUri : function ( request , callback ) {
35+ mapUri ( request , callback ) {
3636 callback ( null , url . format ( {
3737 protocol : "https" ,
3838 host : "api.github.com" ,
Original file line number Diff line number Diff line change @@ -145,13 +145,22 @@ export default Transmit.createContainer(Main, {
145145 * Return a Promise of the previous stargazers + the newly fetched stargazers.
146146 */
147147 allStargazers ( queryParams ) {
148+ /**
149+ * On the server, connect to GitHub directly.
150+ */
148151 let githubApi = "https://api.github.com" ;
149152
153+ /**
154+ * On the client, connect to GitHub via the Hapi proxy route.
155+ */
150156 if ( __CLIENT__ ) {
151157 const { hostname, port} = window . location ;
152158 githubApi = `http://${ hostname } :${ port } /api/github` ;
153159 }
154160
161+ /**
162+ * Load a few stargazers using the Fetch API.
163+ */
155164 return fetch (
156165 githubApi + "/repos/RickWong/react-isomorphic-starterkit/stargazers" +
157166 `?per_page=100&page=${ queryParams . nextPage } `
You can’t perform that action at this time.
0 commit comments