[Solved]Use Bottle Library Program Web Server Enable Updateserverpy Use Python S Import Functional Q37086390
-
We will use the bottle library to program our web server. Toenable this, updateserver.py to use Python’s importfunctionality to give your project access to thebottlelibrary.
Note that repl.it will automatically install the library the firsttime you run your program (and only that first time). Do not besurprised when you can see this happen in the console portion ofyour repl. -
● We will also need code in server.py be able to accessfunctionality we will write inart.py. Use the same importmethodology to create create this link in server.py.
-
● Write code in your server.py file so that bottle handlesrequests that are routed to
“/map.js” by returning your map.js file. (5 Points).
-
● Write another function in your server.py file so thatbottle handles requests that
are routed to “/” by returning your index.html file. (5Points).
-
● Finally, at the end of the file (and outside any function)write the code that starts the web
server.
I have something like this so far. No clue really
import bottle
@bottle.route(“/map.js”)
def returnMapjs():
return bottle.static_file(“map.js”,root=”.”)
bottle.run(host=”0.0.0.0″, port=8080, debug=True)
@bottle.route(“/”)
def returnIndexhtml():
return bottle.static_file(“index.html”,root=”.”)
bottle.run(host=”0.0.0.0″, port=8080, debug=True)
Expert Answer
Answer to We will use the bottle library to program our web server. To enable this, updateserver.py to use Python’s �… . . .
OR

