httpfs

command module
v0.0.0-...-0cb1fdb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 22 Imported by: 0

README

httpfs

Create 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).

go install github.com/progrium/httpfs@latest

Build

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

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