Skip to content

Commit

Permalink
Load env value
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusAhlfors authored Nov 24, 2023
1 parent 138041c commit c465bef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion initialProject/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const post = (url: string, data: any) => fetch(url, {

const Home: NextPage = () => {
const { data, mutate, isLoading, isValidating } = useSWR<ListResponse>('/api/list', get);
const { data: subtitle } = useSWR<string>('/api/subtitle', get);

const handleItemAdd = async () => {
// Tell API to add a new line
Expand Down Expand Up @@ -65,7 +66,7 @@ const Home: NextPage = () => {
<main className={styles.main}>
<h1 className={styles.title}>
What To Do?
<small>{process.env.NEXT_PUBLIC_TEST}</small>
<small>{subtitle || '...'}</small>
</h1>

{isLoading && <div style={{ padding: 50 }}>Loading…</div>}
Expand Down

0 comments on commit c465bef

Please sign in to comment.