Skip to content

pbsds/serve-me-once

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serves some data over HTTP, once. Based on the built-in Python module http.server.

Installation

pip install serve-me-once

Use

from serve_me_once import serve_once, gen_random_port
serve_once(
	"Hello, World",
	timeout=2,
	mime_type="text/html",
	port=gen_random_port()
)

or

from serve_me_once import serve_once_in_background, gen_random_port
import time

addr = serve_once_in_background(
	"Hello, World",
	timeout=2,
	mime_type="text/html",
	port=gen_random_port()
)
print("Hosting at:", addr)
time.sleep(3)

... Why?

The web version of Netron accepts an URL as a query parameter (example). But serving temporary files is a chore. Hence this.

About

Serves some data over HTTP, once

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages