parcel-react-ssr
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "parcel-react-ssr", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Example of SSR with React and ParcelJS", | ||
@@ -9,3 +9,3 @@ "scripts": { | ||
"build-client": "parcel build src/index.html -d dist/client --public-url /dist", | ||
"build-server": "cross-env BABEL_ENV=node babel src -d dist/server", | ||
"build-server": "cross-env BABEL_ENV=node babel src -d dist/server --ignore __tests__", | ||
"test": "jest" | ||
@@ -12,0 +12,0 @@ }, |
@@ -5,2 +5,3 @@ import React from 'react'; | ||
import { GITHUB_TOKEN } from '../constants'; | ||
import HelloWorld from './HelloWorld'; | ||
@@ -10,2 +11,14 @@ import LoginForm from './LoginForm'; | ||
export default function UserPage({ match: { params: { login } } }) { | ||
if (!GITHUB_TOKEN) { | ||
return ( | ||
<h1> | ||
Missing your GitHub token! You must set your environment variable | ||
GITHUB_TOKEN.{' '} | ||
<a href="https://github.com/settings/tokens" target="_blank"> | ||
Go to this page to generate a token with read:user access. | ||
</a> | ||
</h1> | ||
); | ||
} | ||
return ( | ||
@@ -12,0 +25,0 @@ <div> |
export const GITHUB_ENDPOINT = 'https://api.github.com/graphql'; | ||
export const GITHUB_TOKEN = 'ed4f1aab1eb13a4b81adae2f79b5fe8ddf1898d4'; | ||
// You must create your own GitHub token | ||
// https://github.com/settings/tokens | ||
export const GITHUB_TOKEN = process.env.GITHUB_TOKEN; |
200906
328