From 676fb594a41d7d62bfbf75272b4793d472e83318 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sun, 18 Jun 2017 16:21:24 -0700 Subject: [PATCH] Dont make gist request if at / --- pages/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pages/index.js b/pages/index.js index 091443c..df48168 100644 --- a/pages/index.js +++ b/pages/index.js @@ -14,12 +14,14 @@ class Index extends React.Component { /* pathname, asPath, err, req, res */ static async getInitialProps ({ asPath }) { try { - const content = await api.getGist(asPath) - return { content } + if (asPath !== '/') { + const content = await api.getGist(asPath) + return { content } + } } catch (e) { console.log(e) - return {} } + return {} } constructor() {