-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
30 lines (25 loc) · 847 Bytes
/
server.py
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
from waitress import serve
from app import app
import os
import webbrowser
from threading import Timer
def open_browser():
"""Open the browser to the application URL"""
try:
webbrowser.open('http://localhost:8000')
except Exception as e:
print(f"Failed to open browser: {e}")
if __name__ == '__main__':
# Create required directories
os.makedirs('logs', exist_ok=True)
os.makedirs('uploads', exist_ok=True)
os.makedirs('instance', exist_ok=True)
# Open browser after 1.5 seconds
Timer(1.5, open_browser).start()
# Start the server
print("Starting GhostSec server...")
print("Access URLs:")
print("- Local: http://localhost:8000")
print("- Network: http://your-ip:8000")
print("\nPress Ctrl+C to quit")
serve(app, host='0.0.0.0', port=8000, threads=6)