changed directory for json files

This commit is contained in:
IM23a-bachmannj2
2024-09-16 11:24:21 +02:00
parent 7748432913
commit b0d74ddf6a
5 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import json
app = Flask(__name__) app = Flask(__name__)
# Load the data from the JSON file # Load the data from the JSON file
with open('static/data.json') as f: with open('static/json/data.json') as f:
guns = json.load(f) guns = json.load(f)
+2 -2
View File
@@ -3,7 +3,7 @@ let weapons = []; // This will be populated by the fetched JSON data
// Function to fetch weapons data from JSON // Function to fetch weapons data from JSON
function fetchWeaponsData() { function fetchWeaponsData() {
fetch('static/data.json') // Adjust the path to the actual location of your JSON file fetch('static/json/data.json') // Adjust the path to the actual location of your JSON file
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
weapons = data; // Store the fetched data in the global 'weapons' variable weapons = data; // Store the fetched data in the global 'weapons' variable
@@ -57,7 +57,7 @@ function updateWeaponStats(weapon) {
// Function to fetch and populate modifiers from the JSON file // Function to fetch and populate modifiers from the JSON file
function fetchModifiers() { function fetchModifiers() {
fetch('static/modifiers.json') // Adjust the path to your JSON file fetch('static/json/modifiers.json') // Adjust the path to your JSON file
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
populateModifiers(data); populateModifiers(data);