Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurin-Notemann committed Apr 5, 2024
1 parent 1ebf43a commit c0d107a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function validateEnv(env: { [key: string]: any }) {
if (!parsedEnv.success)
throw new Error(
"Failed to Parse Environment Variables: " +
JSON.stringify(parsedEnv.error.issues, null, 2),
JSON.stringify(parsedEnv.error.issues, null, 2),
);

return parsedEnv.data;
Expand Down
4 changes: 1 addition & 3 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { getFrontendUrl } from "./utils";

const server = createHTTPServer({
middleware: cors({
origin: [
getFrontendUrl()
],
origin: [getFrontendUrl()],
credentials: true,
}),
router: appRouter,
Expand Down
8 changes: 3 additions & 5 deletions backend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ export const catchDrizzleErrorManyEntries = async <T extends any[]>(
};

export const getFrontendUrl = () => {
if (env.get("IS_PROD"))
return `https://${env.get("FRONTEND_HOST")}`
else
return `http://${env.get("FRONTEND_HOST")}:${env.get("FRONTEND_PORT")}`
}
if (env.get("IS_PROD")) return `https://${env.get("FRONTEND_HOST")}`;
else return `http://${env.get("FRONTEND_HOST")}:${env.get("FRONTEND_PORT")}`;
};
4 changes: 1 addition & 3 deletions frontend/src/lib/services/authentication/userloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ const getHost = () => {
if (env.IS_DEV)
// TODO: un-hardcode these
return `http://${env.FRONTEND_HOST}:${env.FRONTEND_PORT}`;
else
return `https://${env.FRONTEND_HOST}`;

else return `https://${env.FRONTEND_HOST}`;
};

0 comments on commit c0d107a

Please sign in to comment.