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

173
Views
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
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!