Skip to content

aaron-ortega/pathquest

Repository files navigation

pathquest

Pathquest is a simple file system API using Python's http.server library.

Compatibility

Python 3.9 or greater is required to run the application. The code uses new type hinting features not found in earlier versions of Python.

Installing

  1. Install the source using git

    git clone https://github.com/aaron-ortega/pathquest.git
  2. Install Python 3.9 using Pyenv

    brew install pyenv
    pyenv install 3.9
  3. [Optional] Install Postman to interact with the app

    brew install --cask postman

Running

The server can be initiated using a shell script or Docker. Both methods require a specified root path, $PATH, indicating the starting point.

Script

  1. Navigate into the cloned repo and execute the script

    ./entrypoint.sh $PATH

    Note: Verify the script has execute permission otherwise run the following chmod u+x entrypoint.sh.

Docker

  1. Navigate into the cloned repo and build the image

    cd pathquest
    docker build -f Dockerfile -t pathquest .
  2. Run the application

    docker run --rm -it -p 9000:9000 pathquest $PATH

Setup local Swagger

Since http.server doesn't come with Swagger we will build a local version and point to our app.

  1. Follow the steps detailed here.

  2. Copy swagger.yml into swagger-ui

    cp swagger.yml ./swagger-ui/dev-helpers/swagger.yml
  3. Navigate to ./swagger-ui/dev-helpers/ and replace

    url: "https://petstore.swagger.io/v2/swagger.json",
    

    with

    url: "./swagger.yml",
    

Example: Alt text

TODOs:

  • Add implementaion of remaining CRUD operations
  • Add more docs to swagger.yml

About

Simple file system done for a job interview

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors