chore: put json files in folder and update fetch path

This commit is contained in:
lifeadventurer
2023-12-28 22:31:39 +08:00
parent f95511c480
commit ad5a78a672
5 changed files with 5 additions and 5 deletions

View File

@@ -30,14 +30,14 @@ var fortune_generated = false;
// using async and await to prevent fetching the data too late...
async function fetch_data(){
await fetch("fortune.json")
await fetch("./json/fortune.json")
.then(response => response.json())
.then(data => {
goodFortunes = data.goodFortunes;
badFortunes = data.badFortunes;
})
await fetch("special.json")
await fetch("./json/special.json")
.then(response => response.json())
.then(data => {
special_events = data.special_events;

View File

@@ -18,9 +18,9 @@ const NEED_UPDATE = [
'/generators/fortune_generator/css/styles.css',
'/generators/fortune_generator/js/fortune.js',
'/generators/fortune_generator/js/matrix.js',
'/generators/fortune_generator/special.json',
'/generators/fortune_generator/fortune.json',
'/generators/fortune_generator/manifest.json',
'/generators/fortune_generator/json/special.json',
'/generators/fortune_generator/json/fortune.json',
'/generators/fortune_generator/json/manifest.json',
'https://api.ipify.org/?format=json',
]