Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#61: Fix getting 404 (SERVER_NAME removed from flask app) #63

Merged
merged 2 commits into from
Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably #62 should be declared here :)


## [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