WendySanarwanto / python-api-development

Exercise artefact of Freecodecamp's "Python API Development" online course.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-api-development

Exercise artefact of Freecodecamp's Python API Development online course, authored by Sanjeev Thiyagarajan.

How to run the program in local machine

  • Clone this repository through running this git command:

    git clone https://github.com/WendySanarwanto/python-api-development.git
  • Change current directory into the cloned local repository:

    cd python-api-development
  • Create a new Python Virtual Environment:

    python3 -m venv venv1

    Note that venv1 command argument define the name of the virtual environment we want to create.

  • Activate the created Python Virtual Environment:

    source ./venv1/bin/activate
  • Install FastApi library and its all dependencies:

    pip install "fastapi[all]"
  • Run the API program:

    uvicorn app.main:app --reload --port 18000 --workers 4
  • Run curl command to test the GET posts API:

    curl http://127.0.0.1/posts

END--

About

Exercise artefact of Freecodecamp's "Python API Development" online course.


Languages

Language:Python 100.0%