Skip to content

Commit

Permalink
Use local items.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-james-watson committed Aug 29, 2024
1 parent 298f511 commit b398872
Show file tree
Hide file tree
Showing 2 changed files with 9,996 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ export default function Game() {
const [state, setState] = useState<GameState | null>(null);
const [loaded, setLoaded] = useState(false);
const [started, setStarted] = useState(false);
const [items, setItems] = useState<Item[] | null>(null);
const [items, setItems] = useState<Item[] | null>(null);

React.useEffect(() => {
const fetchGameData = async () => {
const res = await axios.get<string>(
"https://wikitrivia-data.tomjwatson.com/items.json"
);
const res = await axios.get<string>("/items.json");
const items: Item[] = res.data
.trim()
.split("\n")
Expand Down
Loading

0 comments on commit b398872

Please sign in to comment.