Move the example files around for clarity

This commit is contained in:
Michael Lazar 2019-08-24 18:37:13 -04:00
parent 381537825f
commit 65c8a6e47c
5 changed files with 10 additions and 12 deletions

View File

@ -95,7 +95,7 @@ Jetforce will respond to any request containing a URL that don't match your host
with a status of ``Proxy Request Refused``. with a status of ``Proxy Request Refused``.
Using python, you can modify this behavior to do fancy things like building a proxy Using python, you can modify this behavior to do fancy things like building a proxy
server for HTTP requests. See [server_http_proxy.py](examples/server_http_proxy.py) for server for HTTP requests. See [http_proxy.py](examples/http_proxy.py) for
an example of how to accomplish this. an example of how to accomplish this.
### Serving Files ### Serving Files

View File

@ -15,9 +15,9 @@ guestbook = pathlib.Path("guestbook.txt")
app = jetforce.JetforceApplication() app = jetforce.JetforceApplication()
@app.route("$") @app.route("")
def index(request): def index(request):
data = ["Guestbook", "=>/submit Leave a Message", ""] data = ["Guestbook", "=>/submit Sign the Guestbook", ""]
guestbook.touch(exist_ok=True) guestbook.touch(exist_ok=True)
with guestbook.open("r") as fp: with guestbook.open("r") as fp:

View File

@ -38,7 +38,7 @@ https://github.com/michael-lazar/jetforce
EPILOG = """ EPILOG = """
If the TLS cert/keyfile is not provided, a self-signed certificate will If the TLS cert/keyfile is not provided, a self-signed certificate will
automatically be generated and saved to your temporary file directory. automatically be generated and saved to your temporary directory.
""" """
@ -417,12 +417,12 @@ class GeminiServer:
def __init__( def __init__(
self, self,
host: str,
port: int,
certfile: typing.Optional[str],
keyfile: typing.Optional[str],
hostname: str,
app: typing.Callable, app: typing.Callable,
host: str = "127.0.0.1",
port: int = 1965,
certfile: typing.Optional[str] = None,
keyfile: typing.Optional[str] = None,
hostname: str = "localhost",
) -> None: ) -> None:
self.host = host self.host = host
@ -525,9 +525,7 @@ def run_server() -> None:
"--dir", help="Path on the filesystem to serve", default="/var/gemini" "--dir", help="Path on the filesystem to serve", default="/var/gemini"
) )
parser.add_argument( parser.add_argument(
"--index-file", "--index-file", help="The gemini directory index file", default="index.gmi"
help="The gemini directory index file [i.e. index.html]",
default="index.gmi",
) )
args = parser.parse_args() args = parser.parse_args()