I successfully created an svg animation and saved its data as a JSON file (alongside a JS file).
The JavaScript code to render the animation is shown below:
var animation = bodymovin.loadAnimation({
container: document.getElementById('anim'),
renderer: 'svg',
loop: false,
autoplay: true,
path: "data.json"
})
However, when I try to access the file, I encounter a 404 error for the "data.json" file.
- I attempted to serve the files without using Flask, and it worked perfectly fine.
- "data.json" exists in both the current directory (a static folder) and the main directory of my application.
The output from my terminal:
127.0.0.1 - - [08/Apr/2022 22:52:27] "GET /static/js/lottie.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Apr/2022 22:52:27] "GET /static/js/script.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Apr/2022 22:52:28] "GET /data.json HTTP/1.1" 404 -