-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
42 lines (33 loc) · 1.33 KB
/
run.py
File metadata and controls
42 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
"""Main entry point for CodeMapper web application."""
import os
import sys
# Add src to path
sys.path.insert(0, os.path.dirname(__file__))
from src.web.app import create_app
def main():
"""Run the CodeMapper web application."""
import argparse
parser = argparse.ArgumentParser(description="CodeMapper Web Server")
parser.add_argument("--port", "-p", type=int, default=5000, help="Port to run on")
parser.add_argument("--persist-dir", default=".codemap", help="Index storage directory")
parser.add_argument("--repos-dir", default="repos", help="Cloned repos directory")
parser.add_argument("--no-debug", action="store_true", help="Disable debug mode")
args = parser.parse_args()
persist_dir = args.persist_dir
repos_dir = args.repos_dir
port = args.port
debug = not args.no_debug
print(f"""
===================================================
CodeMapper - Semantic Code Search
===================================================
Running at: http://localhost:{port}
Persist dir: {persist_dir}
Repos dir: {repos_dir}
===================================================
""")
app = create_app(persist_dir=persist_dir, repos_dir=repos_dir)
app.run(host="0.0.0.0", port=port, debug=debug)
if __name__ == "__main__":
main()