Sign inSign up

na4va4/py_restapi

By na4va4

•Updated almost 2 years ago

Simple REST API that returns a "Hello World" message in JSON.

Image
0

171

na4va4/py_restapi repository overview

⁠py_restapi

⁠Table of Contents

  1. General Info⁠
  2. Technologies⁠
  3. Installation⁠

⁠General Info


This is a project built in Python using Flask to provide a simple REST API that returns a "Hello World" message in JSON format.

⁠Technologies


A list of technologies used within the project:

⁠Installation


There are two methods to install this project.

⁠Via GitHub

Verify you are python version 3.12.0

python --version

Copy the repository

git clone https://github.com/nava2105/py_restapi.git

Enter the directory

cd ../py_restapi

Create a virtual environment

python -m venv .venv

Activate your virtual environment

  • In Windows
.venv\Scripts\activate

In macOS or Linux

source .venv/bin/activate

Build the dependencies

pip install -r requirements.txt

Run main.py file

  • By using python command
python main.py
  • If you are using Python 3 and python points to Python 2 on your system, use python3 instead:
python3 main.py

Open a browser and enter to http://localhost:5000⁠

Or to review the endpoints in Swagger enter to http:localhost:5000/apidocs⁠

⁠Via Docker-hub

Pull the image from Docker-hub

docker pull na4va4/py_restapi

Start a container from the image

docker run -p 5000:5000 na4va4/py_restapi

Open a browser and enter to http://localhost:5000⁠

Or to review the endpoints in Swagger enter to http:localhost:5000/apidocs⁠

Tag summary

Content type

Image

Digest

sha256:a9ba08f65…

Size

373.9 MB

Last updated

almost 2 years ago

docker pull na4va4/py_restapi