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 };
|
query: { username: string };
|
||||||
req: any;
|
req: any;
|
||||||
}) => {
|
}) => {
|
||||||
let host = process.env.NEXT_PUBLIC_URL;
|
// fix weird bug where host env was undefined on layout render, not direct page render
|
||||||
console.log(host);
|
const url = new URL(
|
||||||
if (context.req) {
|
`https://invest.3zachm.dev/api/fakeUsers?u=${context.query.username}`
|
||||||
// if env breaks ???
|
);
|
||||||
let host = context.req.headers.host;
|
|
||||||
}
|
|
||||||
const url = new URL(`${host}/api/fakeUsers?u=${context.query.username}`);
|
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
let user = await res.json();
|
let user = await res.json();
|
||||||
if (user.error) {
|
if (user.error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue