Skip to content

Commit

Permalink
Merge pull request #63 from idealista/61_Fix_getting_404_on_endpoints
Browse files Browse the repository at this point in the history
#61: Fix getting 404 (SERVER_NAME removed from flask app)
  • Loading branch information
Gkrlo committed Apr 11, 2018
2 parents 88b73f6 + 3bc52ed commit 3868cca
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista/prom2teams/tree/develop)
- *[#61](https://github.com/idealista/prom2teams/pull/63) Fix getting 404 errors - SERVER_NAME removed from flask app* @Gkrlo


## [2.0.2](https://github.com/idealista/prom2teams/tree/2.0.2)
[Full Changelog](https://github.com/idealista/prom2teams/compare/2.0.1...2.0.2)
Expand Down
2 changes: 1 addition & 1 deletion bin/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

if __name__ == "__main__":
host = application.config['HOST']
port = application.config['PORT']
port = int(application.config['PORT'])
application.run(host=host, port=port)
2 changes: 1 addition & 1 deletion prom2teams/app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def init_app(application):


init_app(app)
log.info(app.config['APP_NAME'] + ' started on ' + app.config['SERVER_NAME'])
log.info('{} started on {}:{}'.format(app.config['APP_NAME'], app.config['HOST'], app.config['PORT']))
5 changes: 0 additions & 5 deletions prom2teams/app/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ def _update_application_configuration(application, configuration):
if 'Log' in configuration and 'Path' in configuration['Log']:
application.config['LOG_FILE_PATH'] = configuration['Log']['Path']
if 'HTTP Server' in configuration:
_host, _port = application.config['SERVER_NAME'].split(':', 1)
if 'Host' in configuration['HTTP Server']:
_host = configuration['HTTP Server']['Host']
application.config['HOST'] = _host
if 'Port' in configuration['HTTP Server']:
_port = configuration['HTTP Server']['Port']
application.config['PORT'] = _port
if 'Name' in configuration['HTTP Server']:
application.config['SERVER_NAME'] = configuration['HTTP Server']['Name']
else:
application.config['SERVER_NAME'] = _host + ':' + _port


def _config_provided(filepath):
Expand Down
1 change: 0 additions & 1 deletion prom2teams/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
PORT = 8089
# Flask settings
DEBUG = False
SERVER_NAME = 'localhost:8089'

# Flask-Restplus settings
SWAGGER_UI_DOC_EXPANSION = 'list'
Expand Down

0 comments on commit 3868cca

Please sign in to comment.