Created
February 22, 2019 16:46
-
-
Save jlei523/9492f90819bdc2a90d1e70f4ab9249fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends React.Component { | |
static async getInitialProps({ req, query, asPath, pathname }) { | |
let baseUrl = req ? `${req.protocol}://${req.get("Host")}` : ""; | |
let data = await fetch(baseUrl + 'relativeURL') | |
return { | |
data: data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment