Giter Site home page Giter Site logo

file_browser_service's Introduction

FileBrowserService

The application is a small REST API to display file information from a portion of the user’s file system. The user will specify a root directory when launching the application. All directories from the root on downward are then browsable using the REST API.

Example

For example, if there is a directory /home/my_user/otherstuff/foo/ containing files foo1 and foo2 as well as a subdirectory bar/ which in turn contains a file bar1 and a directory baz/, the user will specify /home/my_user/otherstuff/foo on input and the REST API will be something like:

Endpoints Implemented

  • GET / -> list contents of foo/ (e.g. foo1, foo2, bar/)

  • GET /bar -> list contents of foo/bar/ (e.g bar1, baz/)

  • GET /foo1 -> contents of file foo/foo1

  • GET /bar/bar1 -> contents of file foo/bar/bar1

  • POST /foo3 -> add foo3 file to / directory

  • POST /bar/baz2 add baz2 file to /bar directory

  • POST /qux -> add qux directory to / directory

TODO:

  • PUT foo2 -> replace foo2 file with new foo2

  • PUT baz -> replace baz directory with new baz

  • DELETE / -> delete the content of / directory

  • DELETE /bar -> delete the content of /bar directory

  • DELETE bar1 -> delete file bar1 from /bar directory

Running the service

Building and running the service can be done as followed (default root path is 'src/uploads'):

chmod +x start.sh
./start.sh '/root/path'

Consecutive runs of the service can be done as followed:

chmod +x run.sh
./run.sh

Then visit the api and take a look at the swagger docs

Running Testing locally

To run the tests locally within docker:

docker-compose exec -T api python -m pytest "src/tests"

file_browser_service's People

Contributors

ytulu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.