httpfs

command module
v0.0.0-...-3eec282 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: MIT Imports: 22 Imported by: 0

README

httpfs

Create virtual filesystems using any HTTP framework.

$ tree ~/demo
/Users/progrium/demo
├── greet
│   ├── goodbye
│   └── hello
└── random

2 directories, 3 files

The file tree mounted at ~/demo is powered by this Flask app:

import os, random
from flask import Flask
from autodir import AutoDirMiddleware

app = Flask(__name__)
AutoDirMiddleware(app)

@app.get("/greet/hello")
def hello():
    return "Hello, world!\n"

@app.get("/greet/goodbye")
def goodbye():
    return "Goodbye, world!\n"

@app.get("/random")
def rnd():
    return ''.join(random.choice('abcdefghijklmnopqrstuvwyz') for _ in range(24))+"\n"

All it took was one command:

httpfs -mount ~/demo ./examples/flask-basic/app.py

Don't care for Flask? Use any web framework!

Install

Currently works on Linux and Mac (with MacFUSE). Download from latest release or you can run this installer:

bash -c "$(curl -sSL https://raw.githubusercontent.com/progrium/httpfs/main/install.sh)"

Alternatively you can install using Homebrew:

brew tap progrium/homebrew-taps
brew install httpfs

Build an HTTP filesystem

Check out the examples directory or read the PROTOCOL.md to see how it works.

Roadmap

Full read-write and more coming soon. See our roadmap.

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL