You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
614 B
26 lines
614 B
# -*- coding: UTF-8 -*-
|
|
#!/usr/bin/env pyton3
|
|
from http.server import HTTPServer
|
|
from src.handler import Handler as Handler
|
|
import os, sys, json
|
|
#PORT_NUMBER = 8000
|
|
from findfsdb import create_db
|
|
from utils.utils import load_config
|
|
def run():
|
|
create_db()
|
|
config = load_config()
|
|
if len(config) ==0:
|
|
print("конфиг пустой")
|
|
try:
|
|
print(config['PORT'])
|
|
except KeyError:
|
|
print("KeyError")
|
|
except KeyboardInterrupt:
|
|
pass
|
|
|
|
server = HTTPServer(('', config['PORT']), Handler)
|
|
print ('Started HTTP Server on port ' , config['PORT'])
|
|
server.serve_forever()
|
|
|
|
if __name__ == '__main__':
|
|
run() |