Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

266
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda