mirror of
https://github.com/adulau/mmdb-server.git
synced 2024-11-07 11:36:24 +00:00
chg: [server] make port configurable
This commit is contained in:
parent
eb37aa0cc9
commit
bee9df24fd
2 changed files with 3 additions and 1 deletions
|
@ -19,6 +19,7 @@ config = configparser.ConfigParser()
|
|||
config.read('../etc/server.conf')
|
||||
mmdb_file = config['global'].get('mmdb_file')
|
||||
pubsub = config['global'].getboolean('lookup_pubsub')
|
||||
port = config['global'].getint('port')
|
||||
if pubsub:
|
||||
import redis
|
||||
|
||||
|
@ -85,6 +86,6 @@ app.add_route('/geolookup/{value}', GeoLookup())
|
|||
app.add_route('/', MyGeoLookup())
|
||||
|
||||
if __name__ == '__main__':
|
||||
with make_server('', 8000, app) as httpd:
|
||||
with make_server('', port, app) as httpd:
|
||||
print('Serving on port 8000...')
|
||||
httpd.serve_forever()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
[global]
|
||||
mmdb_file = /home/adulau/git/mmdb-server/db/GeoOpen-country.mmd
|
||||
lookup_pubsub = no
|
||||
port = 8000
|
||||
|
|
Loading…
Reference in a new issue