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

174
Vistas
Serving JS project via Flask application

I'm currently working on getting the javascript project SVGnest to work locally. My optimal solution would be to execute the program via python commands or through an python port. However, I did not find any solution for that.

As a first step, I want to run a flask server now and host the application locally. For that, I've cloned the project and created the following server.py

#!/usr/bin/env python

import flask


# Create the application.
APP = flask.Flask(__name__, template_folder=".", static_folder=".")


@APP.route('/')
def index():
    """ Displays the index page accessible at '/'
    """
    return flask.render_template('index.html')


if __name__ == '__main__':
    APP.debug=True
    APP.run()

The server starts at localhost, however, a lot of files cannot be loaded:

127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /font/latolatinfonts.css HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /style.css HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /util/pathsegpolyfill.js HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /util/domparser.js HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /util/matrix.js HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /util/clipper.js HTTP/1.1" 404 -
127.0.0.1 - - [27/Jan/2022 13:22:17] "GET /util/parallel.js HTTP/1.1" 404 -
....

Seems like the server does not find the files, although they are in the same directory as the index.html. My directories are

  • SVGNest
    • font/
    • img/
    • util/
    • index.html
    • server.py
    • style.css
    • svgnest.js -svgparser.js

Thanks for helping

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