stephen schuresko 00d7a9fbec
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 9s
Build and Push to Private Registry101 / deploy (push) Successful in 7s
feat: add ingress configuration for papi-mast in Helm chart
2025-02-20 12:44:25 -05:00

Posts API

This is the Posts API project, a simple API for managing blog posts.

Table of Contents

Installation

  1. Clone the repository:
    git clone https://git.fairfaxmedia.net/posts-api/papi-py.git
    
  2. Navigate to the project directory:
    cd papi-py
    
  3. Install the dependencies:
    pip install -r requirements.txt
    

Usage

To start the server, run:

python3 papi.py

To start with an alternative database location(postgresql) Use the following

DATABASE_URL='postgresql+psycopg2://user:password@hostname/database_name' python3 papi.py

Endpoints

GET /posts

Retrieve a list of all posts.

POST /posts

Create a new post.

GET /posts/{id}

Retrieve a specific post by ID.

PUT /posts/{id}

Update a specific post by ID.

DELETE /posts/{id}

Delete a specific post by ID.

Unit Tests

make coverage

This runs coverage tests and stores the html coverage report along with functions tested in htmlcov

deploy...

Please log into the connected container registry on Makefile:4 WHERE it says REGISTRY= using the docker login command

feel free to edit the VER= tag ensure you are logged into kubernetes so that commands kubectl and helm both work

then run

make deploy

Integration testing instructions

to test live on papi.kube-dev.fairfaxmedia.net run the following:

 make integration  -e LIVE_HOST=http://papi.kube-dev.fairfaxmedia.net

to integration-test on localhost on the default port run

make integration

openapi spec:

openapi.json

swagger-ui

helm deployment

helm  upgrade papi ./papi-helm/ -f ./papi-helm/v.${ENV}.yaml --set image.tag=${TAG}  --set env.VERSION=${VER}

or alternatively

make deploy

postman-like hopscotch collection:

hopscotch_collection.json can be imported into the following tool hopscotch-ui

kubernetes dashboard plane:

kubernetes

git-ci server

Description
No description provided
Readme 194 KiB
Languages
Python 67.8%
Makefile 16.5%
Smarty 13.8%
Dockerfile 1.9%