satyamvats5 / TREE_DB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TREE DB

Steps To Use:-

i) Clone the Repository
ii) Go inside the Repo.
iii) TO RUN TESTS
      Build and run docker image with following commands
             iii.i) docker build -t assign -f Dockerfile.test .
             iii.ii) docker run -it assign

iV) TO RUN Appllication:-
             iv.i) docker build -t assign .
             iv.ii)docker run -it -p 5000:5000 assign

NOTE :- It will run the application in port 5000 inside container and we have expose the same 5000 port inside the container to 5000 on our host machine.

Config Options available on flask app using CMD

We can pass command line params while running application Options available :-
      i) -h or --host can be used as python app.py -h localhost or python app.py --host=localhost
      ii) -p or --port can be used as python app.py -h localhost -p 5002 or python app.py --port=5002
      iii) -d can be used to activate debug mode python app.py -d

NOTE:- If any option will not be provided default one will be taken.

Available APIs

A swagger documentation has been created for the API.
      => For accesing swagger docs :- GET htttp://host_name:port_number/
      => For Fetching data :- GET http://host_name:port_number/api/v1/query With possible filters of country(list of strings) and device(list of strings).
      => For Inserting data:- POST http://host_name:port_number/aip/v1/insert with payload containing a country(string), a device(string), webreq(int) and timespent(int) values.

About


Languages

Language:Python 98.8%Language:Dockerfile 1.2%