Skip to content

seograth/dev-ops-assignment-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Project

This is a simple FastAPI project with a basic API and tests.

Setup

  1. Clone the repository:

    git clone <repository_url>
    cd fastapi_project
  2. Create a virtual environment and activate it:

    python3 -m venv env
    source env/bin/activate
    
    OR for PowerShell
    
    .\env\Scripts\Activate.ps1
    (use https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4 in case of execution failure)
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Run the application:

    uvicorn app.main:app --reload
  5. Run the tests:

    pytest

Docker

  1. Build the Docker image:

    docker build -t fastapi-project .
  2. Run the Docker container:

    docker run -p 80:80 fastapi-project

Endpoints

  • GET / - Returns a welcome message
  • GET /items/{item_id} - Returns item details with optional query parameter q

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 79.4%
  • Dockerfile 20.6%