Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Flask: Cannot find JSON file from JS

I managed to render an svg animation and export its data as a JSON file (along with a JS file).

I included a JS file that renders the animation and it goes like this:

var animation = bodymovin.loadAnimation({
    container: document.getElementById('anim'),
    rederer: 'svg',
    loop: false,
    autoplay: true,
    path: "data.json"
})

However when I serve the file, I get a 404 on the "data.json" file.

  • I tried serving the files without flask and it works.
  • "data.json" is in the current directory (a static folder) AND in the main directory (where my application is).

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 -
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It's /static/data.json unless you configured it differently.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!