costapy/costa.py
Dita Aji Pratama d4ca69fb2b First Commit
2022-03-16 11:06:52 +07:00

24 lines
684 B
Python

import sys
import cherrypy
import handler
from config import server
from config import directory
if __name__ == '__main__':
dirconfig = directory.dirconfig
update = server.update
if len(sys.argv) >= 3:
update["server.socket_host"] = sys.argv[1]
update["server.socket_port"] = int(sys.argv[2])
cherrypy.config.update ( update )
cherrypy.quickstart ( handler.handler(), config = dirconfig )
else:
print ("Usage : python<ver> costa.py <ip_address> <port> <service_name>")
print ("Example : python3 costa.py localhost 81 CostaPySample")