Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda