Dont make gist request if at /

main
Mike Fix 8 years ago
parent c61f2184a9
commit 676fb594a4

@ -14,12 +14,14 @@ class Index extends React.Component {
/* pathname, asPath, err, req, res */ /* pathname, asPath, err, req, res */
static async getInitialProps ({ asPath }) { static async getInitialProps ({ asPath }) {
try { try {
const content = await api.getGist(asPath) if (asPath !== '/') {
return { content } const content = await api.getGist(asPath)
return { content }
}
} catch (e) { } catch (e) {
console.log(e) console.log(e)
return {}
} }
return {}
} }
constructor() { constructor() {

Loading…
Cancel
Save