Skip to content

Commit

Permalink
Added endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
AiglonDore committed Dec 17, 2023
1 parent 6258b21 commit 002b1c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN pip install -r requirements.txt

COPY . .

VOLUME [ "/var/log" ]

EXPOSE 5000/tcp

CMD ["python", "core/__main__.py"]
6 changes: 6 additions & 0 deletions core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

app = Flask(__name__)

@app.route('/', methods=['GET'])
def index():
logging.info('Request received from %s', request.remote_addr)
logging.info("Sending index page")
return jsonify({'message': 'To get your IP, send a GET request to /ip'})

@app.route('/ip', methods=['GET'])
def get_public_ip():
try:
Expand Down

0 comments on commit 002b1c5

Please sign in to comment.