Skip to content

mdashaikh/devops-coding-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is small flask app. This app will show request headers and client ip address in JSON format.

Installation

Clone the repository, then install required python modules (see requirements.txt). Then, you can run this app using this command

./app.py

It will listen on all interface on port 5000.

Notes: This method is not suitable for production as it doesn’t scale well and by default serves only one request at a time. Read Flask documentation for deployment in production

Example output

Using curl, assuming app listen on ip address 10.10.10.20. and curl running on host with ip address 10.10.10.1

curl http://10.10.10.20:5000/

output

{
  "headers": {
    "Accept": "*/*",
    "Content-Length": "",
    "Content-Type": "",
    "Host": "10.10.10.20:5000",
    "User-Agent": "curl/7.51.0"
  },
  "origin": "10.10.10.1"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%