changed directory for json files
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user