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 1
1
{
2
2
"name" : " react-isomorphic-starterkit" ,
3
3
"description" : " Isomorphic starterkit with server-side React rendering." ,
4
- "version" : " 2.3.2 " ,
4
+ "version" : " 2.3.3 " ,
5
5
"license" : " BSD-3" ,
6
6
"repository" : {
7
7
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ server.route({
24
24
} ) ;
25
25
26
26
/**
27
- * Endpoint that proxies all requests to api.github.com
27
+ * Endpoint that proxies all GitHub API requests to https:// api.github.com.
28
28
*/
29
29
server . route ( {
30
30
method : "*" ,
31
31
path : "/api/github/{path*}" ,
32
32
handler : {
33
33
proxy : {
34
34
passThrough : true ,
35
- mapUri : function ( request , callback ) {
35
+ mapUri ( request , callback ) {
36
36
callback ( null , url . format ( {
37
37
protocol : "https" ,
38
38
host : "api.github.com" ,
Original file line number Diff line number Diff line change @@ -145,13 +145,22 @@ export default Transmit.createContainer(Main, {
145
145
* Return a Promise of the previous stargazers + the newly fetched stargazers.
146
146
*/
147
147
allStargazers ( queryParams ) {
148
+ /**
149
+ * On the server, connect to GitHub directly.
150
+ */
148
151
let githubApi = "https://api.github.com" ;
149
152
153
+ /**
154
+ * On the client, connect to GitHub via the Hapi proxy route.
155
+ */
150
156
if ( __CLIENT__ ) {
151
157
const { hostname, port} = window . location ;
152
158
githubApi = `http://${ hostname } :${ port } /api/github` ;
153
159
}
154
160
161
+ /**
162
+ * Load a few stargazers using the Fetch API.
163
+ */
155
164
return fetch (
156
165
githubApi + "/repos/RickWong/react-isomorphic-starterkit/stargazers" +
157
166
`?per_page=100&page=${ queryParams . nextPage } `
You can’t perform that action at this time.
0 commit comments