Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

pbgnz/httpfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpfs

httpfs is a simple file server

Requirements

  1. Go 1.7 or later

Installation

go get -u github.com/pbgnz/httpfs

Detailed Usage

General

server

httpfs is a simple file server.

usage: httpfs [-v] [-p PORT] [-d PATH-TO-DIR]
    -v Prints debugging messages.
    -p Specifies the port number that the server will listen and serve at. 
    Default is 8080.
    -d Specifies the directory that the server will use to read/write requested files. 
    Default is the current directory when launching the application.

client

GET / returns a list of the current files in the data directory.

curl -get localhost:8080/

httpc -p 8080 get 'http://localhost:8080/'

GET /foo.txt returns the content of the file named foo.txt in the data directory.

curl -get localhost:8080/foo.txt

httpc -v -p 8080 get 'http://localhost:8080/foo.txt'

POST /bar should create or overwrite the file named bar in the data directory with the content of the body of the request.

curl -post -d "foo" localhost:8080/bar.txt

httpc -p 8080 -h Content-Type:application/text -d 'foo' post 'http://localhost:8080/bar.txt'

About

httpfs is a simple file server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages