-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adicionando configuração de BIND SERVER
- Loading branch information
duzzsys
committed
May 22, 2020
1 parent
11ec9e1
commit eb06a6d
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,21 @@ | |
#__author__ = Pablo Mariz, [email protected] | ||
#Python3 | ||
|
||
import configparser | ||
from flask import Flask, jsonify, request | ||
from model import Backend | ||
app = Flask(__name__) | ||
backend = Backend() | ||
|
||
def bind_server(): | ||
config = configparser.ConfigParser() | ||
config.read('conf.cfg') | ||
|
||
server_address = config.get('config_server', 'server_address') | ||
server_port = config.get('config_server', 'server_port') | ||
|
||
return [server_address, server_port] | ||
|
||
#adicionar novo motorista - FUNCIONANDO | ||
@app.route('/novo_veiculo', methods=['POST']) | ||
def novo_veiculo(): | ||
|
@@ -416,4 +426,5 @@ def realizar_logoff(): | |
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) | ||
server_address, server_port = bind_server() | ||
app.run(host=server_address, port=server_port) |