v1.0.159: SO_REUSEADDR + app.js via Python
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Contracts VM server — thin HTTP router. All logic in db/ and services/."""
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from socketserver import ThreadingMixIn
|
||||
from socketserver import ThreadingMixIn, TCPServer
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
import json, re, os
|
||||
|
||||
@@ -227,6 +227,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
TCPServer.allow_reuse_address = True
|
||||
port = int(os.environ.get("PORT", "8766"))
|
||||
server = ThreadingHTTPServer(("0.0.0.0", port), Handler)
|
||||
print(f"Contracts VM server on :{port}, db={DB_CONFIG['dbname']}")
|
||||
|
||||
Reference in New Issue
Block a user