Skip to content

alliequintano/simpleapi

Repository files navigation

simpleapi

Build Status

Creates a simple web service that returns the current time as JSON data. Includes a CLI client application that connects to the web service, parses the response, and displays the time.

Requirements

To install and run the client and server, you need:

  • Python 3.7
  • virtualenv

Installation

The commands below set everything up to run the client and server:

$ git clone https://github.com/alliequintano/simpleapi.git
$ cd simpleapi
$ virtualenv -p python3.7 venv
$ . venv/bin/activate
(venv) pip install -r requirements.txt
(venv) ./install_client.sh

Note for Windows users: replace the virtual environment activation command above with venv\Scripts\activate.

Run

To run the client and server together:

./run.sh

Note: the server will run in the background.
Use ps ax | grep run_server.py and kill PID or pkill -f run_server.py to stop server when you're done.

To run the server by itself:

python run_server.py

To run the CLI client:

(venv) client
Usage: client [OPTIONS] COMMAND

  A CLI wrapper for the client clock application.
    
Options:
  --help  Show this message.

Commands:
  clock   Display the current time.
 
(venv) client clock
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors