Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cixtor/fileserver
Command line tool to expose the content of a directory over HTTP
https://github.com/cixtor/fileserver
Last synced: 10 days ago
JSON representation
Command line tool to expose the content of a directory over HTTP
- Host: GitHub
- URL: https://github.com/cixtor/fileserver
- Owner: cixtor
- License: mit
- Created: 2016-11-29T23:01:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-29T05:52:16.000Z (about 3 years ago)
- Last Synced: 2024-06-20T03:42:09.215Z (6 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# File Server [![GoReport](https://goreportcard.com/badge/github.com/cixtor/fileserver)](https://goreportcard.com/report/github.com/cixtor/fileserver) [![GoDoc](https://godoc.org/github.com/cixtor/fileserver?status.svg)](https://godoc.org/github.com/cixtor/fileserver)
> In computing, a file server (or fileserver) is a computer attached to a network that has the primary purpose of providing a location for shared disk access, i.e. shared storage of computer files (such as documents, sound files, photographs, movies, images, databases, etc.) that can be accessed by the workstations that are attached to the same computer network. The term server highlights the role of the machine in the client–server scheme, where the clients are the workstations using the storage.
>
> A file server is not intended to perform computational tasks, and does not run programs on behalf of its clients. It is designed primarily to enable the storage and retrieval of data while the computation is carried out by the workstations.
>
> — http://en.wikipedia.org/wiki/File_server## Installation
```
go get -u github.com/cixtor/fileserver
```## Usage
Run `fileserver` to start a file server in the current working directory, listening on a random ephemeral port number.
```
$ fileserver
File Server
Listening on http://localhost:55265
Started at Wed Jan 30 13:36:26 2019
Document root is /Users/cixtor/public_html
Press Ctrl-C to quit.
^C
Server stopped
```Use `-d` to point the file server to a specific directory, and `-p` to use a specific port number, like so:
```
$ fileserver -p 8080
File Server
Listening on http://localhost:8080
Started at Wed Jan 30 13:36:26 2019
Document root is /Users/cixtor/public_html
Press Ctrl-C to quit.
[::1] - - [30/Jan/2019:21:36:36 +0000] "GET /index.html HTTP/1.1" 301 0 0.0000s
[::1] - - [30/Jan/2019:21:36:36 +0000] "GET / HTTP/1.1" 200 225 0.0004s
[::1] - - [30/Jan/2019:21:36:40 +0000] "GET /logger.go HTTP/1.1" 200 976 0.0090s
[::1] - - [30/Jan/2019:21:36:48 +0000] "GET /README.md HTTP/1.1" 200 1161 0.0003s
[::1] - - [30/Jan/2019:21:36:50 +0000] "GET /.git/ HTTP/1.1" 200 463 0.0005s
[::1] - - [30/Jan/2019:21:36:53 +0000] "GET /.git/HEAD HTTP/1.1" 200 23 0.0002s
^C
Server stopped
```