nope, fix tmrw
This commit is contained in:
parent
635fa9d5c5
commit
8bb4053990
1 changed files with 4 additions and 7 deletions
|
@ -555,13 +555,10 @@ UserPage.getInitialProps = async (context: {
|
|||
query: { username: string };
|
||||
req: any;
|
||||
}) => {
|
||||
let host = process.env.NEXT_PUBLIC_URL;
|
||||
console.log(host);
|
||||
if (context.req) {
|
||||
// if env breaks ???
|
||||
let host = context.req.headers.host;
|
||||
}
|
||||
const url = new URL(`${host}/api/fakeUsers?u=${context.query.username}`);
|
||||
// fix weird bug where host env was undefined on layout render, not direct page render
|
||||
const url = new URL(
|
||||
`https://invest.3zachm.dev/api/fakeUsers?u=${context.query.username}`
|
||||
);
|
||||
const res = await fetch(url);
|
||||
let user = await res.json();
|
||||
if (user.error) {
|
||||
|
|
Loading…
Reference in a new issue