~mapperr/revvy

568da7b62a1df3b4c754707abb79b6cb12f67431 — mapperr 2 years ago be217b5
Improve help msg
1 files changed, 16 insertions(+), 3 deletions(-)

M main.py
M main.py => main.py +16 -3
@@ 2,15 2,23 @@

Usage:
  revvy <listening_port> <mapping1> [<mapping2>] [<mapping3>]
  revvy (version | --version)

Note:
    - a mapping is: "/path|http://localhost:4200"
    - a mapping is: "<path>:<host>:<port>", i.e. "/api:localhost:8080"
    - if the request path starts with "<path>", then the request is routed to "<host>:<port>"
    - mappings are evaluated in order, so put your 'catch-all' (i.e. "/:localhost:4200") for last

Example:
    - develop a fullstack SpringBoot (context-root=/api) + Angular application on localhost:
        revvy 9999 /api:localhost:8080 /:localhost:4200
        and then open localhost:9999 on your browser
        (eventually adjust your Angular api baseurl to point at localhost:9999)
"""
import logging
import os
import sys

from pathlib import Path
from docopt import docopt
import revvy as r



@@ 20,6 28,8 @@ def main() -> int:

    args = docopt(str(__doc__), version=f"{c.appname} v{c.appversion}")

    Path(c.temp_dir_path).mkdir(0o755, parents=True, exist_ok=True)

    log_file = c.temp_dir_path + os.sep + f"{c.appname}.log"
    logging.captureWarnings(True)
    logging.basicConfig(


@@ 39,4 49,7 @@ def main() -> int:


if __name__ == "__main__":
    sys.exit(main())
    try:
        sys.exit(main())
    except:
        sys.exit(1)