Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brignano authored Jul 21, 2024
1 parent 7dd4ba3 commit 816c770
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 58 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
LOG_LEVEL=info
REACT_EDITOR=code
API_URL="http://localhost:3000/api"
# update below values in .env.local
JSON_RESUME_URL=""
GOOGLE_MAPS_API_KEY=""
49 changes: 0 additions & 49 deletions app/api/resume/route.ts

This file was deleted.

29 changes: 21 additions & 8 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
import About from "@/app/_components/_about/about";
import { Suspense } from "react";
import LoadingSpinner from "./_components/loading-spinner";
import { parseResume } from "./_utils/schemas";
import getConfig from "next/config";
import LoadingSpinner from "./_components/loading-spinner";
import { Suspense } from "react";
import { logger } from "./_utils/logger";

async function getResume() {
const { publicRuntimeConfig } = getConfig();

const getResume = async () => {
const response = await fetch(process.env.API_URL + `/resume`, {
if (!publicRuntimeConfig.jsonResumeUrl) {
logger.warn(`Failed to find environment variable: JSON_RESUME_URL`);
}

logger.info("Fetching resume...");
logger.debug(publicRuntimeConfig.jsonResumeUrl);

const response = await fetch(publicRuntimeConfig.jsonResumeUrl, {
//! todo: remove cache strategy
cache: "no-cache",
});

if (!response.ok) {
return null;
logger.error(`Failed to GET JSON file. Please validate the URL exists (and is publically accessible): ${publicRuntimeConfig.jsonResumeUrl}`);
}

// return await response.json();
return parseResume(await response.json());
};
try {
return await parseResume(await response.json());
} catch (e) {
logger.error(e);
}
}

export default async function Resume() {
const { publicRuntimeConfig } = getConfig();
Expand Down

0 comments on commit 816c770

Please sign in to comment.