reduced banner
This commit is contained in:
parent
f2d565e7d9
commit
0ca2211f69
39
run.py
39
run.py
|
|
@ -37,37 +37,26 @@ def get_port():
|
||||||
return "8000"
|
return "8000"
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("🚀 Starting NoteDiscovery...\n")
|
# Make sure runtime deps are present before invoking uvicorn.
|
||||||
|
|
||||||
# Check if requirements are installed
|
|
||||||
try:
|
try:
|
||||||
import fastapi
|
import fastapi # noqa: F401
|
||||||
import uvicorn
|
import uvicorn # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("📦 Installing dependencies...")
|
print("Installing dependencies...")
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
||||||
|
|
||||||
# Create data directories
|
|
||||||
Path("data").mkdir(parents=True, exist_ok=True)
|
Path("data").mkdir(parents=True, exist_ok=True)
|
||||||
Path("plugins").mkdir(parents=True, exist_ok=True)
|
Path("plugins").mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# Get port from config or environment
|
|
||||||
port = get_port()
|
port = get_port()
|
||||||
|
|
||||||
print("✓ Dependencies installed")
|
# Short pre-launch banner. Detailed startup logs come from uvicorn /
|
||||||
print("✓ Directories created")
|
# backend.main below (INFO: / WARNING: / ERROR:), so the user can tell
|
||||||
print("\n" + "="*50)
|
# exactly when the server is actually accepting connections.
|
||||||
print("🎉 NoteDiscovery is running!")
|
print(f"🚀 NoteDiscovery → http://localhost:{port}")
|
||||||
print("="*50)
|
print(f" notes: ./data/ plugins: ./plugins/ stop: Ctrl+C")
|
||||||
print(f"\n📝 Open your browser to: http://localhost:{port}")
|
print()
|
||||||
print("\n💡 Tips:")
|
|
||||||
print(" - Press Ctrl+C to stop the server")
|
|
||||||
print(" - Your notes are in ./data/")
|
|
||||||
print(" - Plugins go in ./plugins/")
|
|
||||||
print(f" - Change port with: PORT={port} python run.py")
|
|
||||||
print("\n" + "="*50 + "\n")
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
subprocess.call([
|
subprocess.call([
|
||||||
sys.executable, "-m", "uvicorn",
|
sys.executable, "-m", "uvicorn",
|
||||||
"backend.main:app",
|
"backend.main:app",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue