# set webRoot index.html locationwebRoot="etc/www"
with
# Determine the directory where this script is located.script_dir=os.path.dirname(os.path.realpath(__file__))# Go up one level from the modules directory to the project root.project_root=os.path.abspath(os.path.join(script_dir,".."))# Build the absolute path to the webRoot folder; to where index.html is located.webRoot=os.path.join(project_root,"etc","www")
Allows for it to be started as a service using absolute paths.
In
https://github.com/SpudGunMan/meshing-around/blob/main/modules/web.py
replace
```python
# set webRoot index.html location
webRoot = "etc/www"
```
with
```python
# Determine the directory where this script is located.
script_dir = os.path.dirname(os.path.realpath(__file__))
# Go up one level from the modules directory to the project root.
project_root = os.path.abspath(os.path.join(script_dir, ".."))
# Build the absolute path to the webRoot folder; to where index.html is located.
webRoot = os.path.join(project_root, "etc", "www")
```
Allows for it to be started as a service using absolute paths.
<!-- github-sync-id:2834178224 -->
print(f"Serving reports at http://localhost:{PORT} Press ^C to quit.\n\n")
Do this as well.
# Set the desired IP addressserver_ip='127.0.0.1'# Create the HTTP server instance with the desired IP addresshttpd=http.server.HTTPServer((server_ip,PORT),QuietHandler)# Print out the URL using the IP address stored in server_ipprint(f"Serving reports at http://{server_ip}:{PORT} Press ^C to quit.\n\n")
Allowing for one to change the server_ip this gets attached to. In my case I'm using a VPN IP.
Instead of this
```python
print(f"Serving reports at http://localhost:{PORT} Press ^C to quit.\n\n")
```
Do this as well.
```python
# Set the desired IP address
server_ip = '127.0.0.1'
# Create the HTTP server instance with the desired IP address
httpd = http.server.HTTPServer((server_ip, PORT), QuietHandler)
# Print out the URL using the IP address stored in server_ip
print(f"Serving reports at http://{server_ip}:{PORT} Press ^C to quit.\n\n")
```
Allowing for one to change the server_ip this gets attached to. In my case I'm using a VPN IP.
<!-- github-comment-id:2638298898 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
https://github.com/SpudGunMan/meshing-around/blob/main/modules/web.py
replace
with
Allows for it to be started as a service using absolute paths.
Instead of this
Do this as well.
Allowing for one to change the server_ip this gets attached to. In my case I'm using a VPN IP.
thanks :)