292 questions
-1
votes
0
answers
123
views
Getting directory listing for sub-pages of static site built with nextjs [duplicate]
I am testing nextjs as an alternative to gatsbyjs, which I've been using to run a site for a few years. Everything works fine with npm run dev, but with npm run build I get the expected out directory, ...
0
votes
0
answers
252
views
Python ThreadingHTTPServer interacting with the main thread how to?
I am using Python 3.9 on a Raspberry Pi. I'm using a http.server.ThreadingHTTPServer so that I can run other tasks concurrently while handling HTTP requests. My needs are simple, so I don't want to ...
0
votes
1
answer
148
views
Add Content-Type header to Very simple SimpleHTTPRequestHandler without extending the class
I have an extremely simple http server setup for local testing:
#!/usr/bin/env python
from functools import partial
from http.server import SimpleHTTPRequestHandler, test
import os
HTTP_DIR = os....
-1
votes
1
answer
162
views
Why can't my web client accept an image from my web server?
I this is my java HTTP server:
public class WebServer implements Runnable {
public static final int PORT = 80;
@Override
public void run() {
HttpServer $server;
try {
...
0
votes
1
answer
2k
views
How can I host the folder's content for anyone to access and have my device act as a server while it's running?
I'm trying to share a folder for anyone to access while running the code by making my local machine act as a server
PORT = 8000
DIRECTORY = "/content/sample_data"
class Handler(http.server....
0
votes
0
answers
22
views
error when trying to connect to my websitename(Centos)
I'm trying to set up very basic http server on my hosting(centos)
The script is:
#!/usr/bin/env python3.8
from http.server import HTTPServer, BaseHTTPRequestHandler
class SimpleHTTPRequestHandler(...
0
votes
1
answer
1k
views
How to read image from python http.server POST requests without downloading
I'm new to python and http.server, I'm doing a simple API which allow client to post an image and server can do something with that image.
Below is my do_POST method:
class Server(...
0
votes
0
answers
209
views
FileNotFoundError even though Absolute Path Specified
I am running a simple python webserver [SimpleHTTPServer] in my Linux . Wrote a python program to download all the files hosted in that server to my Windows Machine . But for some reason program is ...
2
votes
0
answers
1k
views
Page loading shows pending status in chrome dev tools network tab, for python SimpleHttpServer
I have created python http server using http.server.SimpleHTTPRequestHandler, below is the code for it
PORT = 8008
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("&...
4
votes
2
answers
6k
views
http.server (SimpleHTTPServer) serve file.html instead of dir (using cmd)
Is it possible to serve not a index of a directory but rather an html file using Python SimpleHTTPServer on path '/'?
Having directory with one file login.html serves a directory index on path '/'.
...
1
vote
0
answers
345
views
Unable to access file on local http-server from javascript fs
I'm trying to access the directory listing of files from the http-server webserver listing configured on the localhost:4040.
I have uploaded files using the http-server to mimic a file server for ...
0
votes
1
answer
2k
views
I'm using http.server with python3 and I want to store a request as a variable
I have this code
httpd = HTTPServer(('127.0.0.1', 8000),SimpleHTTPRequestHandler)
httpd.handle_request()
httpd.handle_request() serves one request and then kills the server like intended. I want to ...
1
vote
0
answers
309
views
Javascript not functioning when conducting local testing
Good Morning/Afternoon/Evening all,
I'm working on developing a fairly simple webpage, I have index.html setting up the appearance of the page and in the header I have a link to a js file:
<script ...
0
votes
1
answer
2k
views
Simple http Server does not work when converted to exe
I wrote a simple python http server to serve the files(folders) of the present working directory.
import socketserver
http=''
def httpServer(hostIpAddress):
global http
socketserver.TCPServer....
0
votes
1
answer
2k
views
Running Python’s SimpleHTTPServer in a GUI
I am writing a GUI wrapper around Python’s SimpleHTTPServer. It looks like this:
The GUI uses tkinter. When I click on the OK button, it launches the web server.
The web server code is based on the ...