Skip to content

Commit

Permalink
added env for base url
Browse files Browse the repository at this point in the history
  • Loading branch information
benhalverson committed Oct 2, 2024
1 parent e857ece commit c29cbb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BASE_URL=""
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ dist-ssr
# wrangler files
.wrangler
.dev.vars
.env
.env.local
4 changes: 2 additions & 2 deletions src/components/colorPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useState, useEffect } from "react";
import { useQuery } from "@tanstack/react-query";
import { Radio, RadioGroup } from "@headlessui/react";
import { ColorsResponse } from "../interfaces";

const BASE_URL = import.meta.env.VITE_BASE_URL;

const ColorPicker: React.FC<Props> = ({filamentType}) => {
const url = new URL(`https://3dprinter-web-api.benhalverson.workers.dev/colors`);
const url = new URL(`${BASE_URL}/colors`);

const fetchColors = async (filamentType: string) => {

Expand Down

0 comments on commit c29cbb9

Please sign in to comment.