-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f05a8
commit 9953a93
Showing
7 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import click | ||
from pathlib import Path | ||
|
||
|
||
@click.command() | ||
@click.option( | ||
"--data", | ||
type=click.Path( | ||
exists=True, | ||
file_okay=False, | ||
resolve_path=True, | ||
dir_okay=True, | ||
path_type=Path, | ||
), | ||
default=None, | ||
envvar="AEXPY_SERVER_DATA", | ||
help="Path to data storage directory.", | ||
) | ||
@click.option("-d", "--debug", is_flag=True, help="Debug mode.") | ||
@click.option("-p", "--port", type=int, default=8008, help="Port to listen on.") | ||
def serve(debug: "bool" = False, port: "int" = 8008): | ||
def serve(data: Path | None = None, debug: bool = False, port: int = 8008): | ||
"""Serve web server.""" | ||
from .entrypoint import serve as inner, buildApp | ||
|
||
inner(buildApp(), debug, port) | ||
inner(buildApp(data), debug, port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters