-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
34 lines (25 loc) · 829 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
31
32
33
34
#!/usr/bin/env python
import logging
import optparse
import sys
sys.dont_write_bytecode = True
__import__("lib.utils.versioncheck") # this has to be the first non-standard import
from sqlmap import modulePath
from lib.core.common import setPaths
from lib.core.data import logger
from lib.core.settings import RESTAPI_DEFAULT_ADAPTER
from lib.core.settings import RESTAPI_DEFAULT_ADDRESS
from lib.core.settings import RESTAPI_DEFAULT_PORT
from lib.utils.api import client
from lib.utils.api import server
def main():
"""
REST-JSON API main function
"""
# Set default logging level to debug
logger.setLevel(logging.DEBUG)
# Initialize paths
setPaths(modulePath())
server(RESTAPI_DEFAULT_ADDRESS, RESTAPI_DEFAULT_PORT, adapter=RESTAPI_DEFAULT_ADAPTER)
if __name__ == "__main__":
main()