Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.64 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.64 KB

HNG INTERNSHIP - API

Setting up

Install Dependencies

  1. Python 3.7 - Follow instructions to install the latest version of python for your platform in the python docs

  2. Virtual Environment - I recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized. Instructions for setting up a virtual environment for your platform can be found in the python docs

  3. PIP Dependencies - Once your virtual environment is setup and running, install the required dependencies by running:

pip install -r requirements.txt

Key Pip Dependencies

  • Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.

Run the Server

From within the ./src directory first ensure you are working using your created virtual environment.

To run the server, execute:

export FLASK_APP=app.py
export FLASK_DEBUG=development
flask run --reload

The --reload flag will detect file changes and restart the server automatically.

Documentation Example

GET '/'

  • Fetches a dictionary
  • Request Arguments: None
  • Returns: An object with keys, age, backend, bio, slackUsername, that contains an object of category: data key: value pairs.
{
  "age": 23, 
  "backend": true, 
  "bio": "My name is Richard Olaoluwa Akintola, a Full Stack Developer", 
  "slackUsername": "laolu"
}