Socat

Host a simple html page
while true; do 
    echo -e "HTTP/1.1 200 OK\r\nContent-Length: $(wc -c < index.html)\r\nContent-Type: text/html\r\n\r\n$(cat index.html)" | socat - TCP-LISTEN:8080,reuseaddr; 
done
Host a simple txt file
echo -e "HTTP/1.1 200 OK\r\nContent-Length: $(wc -c < index.html)\r\nContent-Type: text/plain\r\n\r\n$(cat index.html)" | socat - TCP-LISTEN:8080,reuseaddr