File tree 4 files changed +22
-17
lines changed
4 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
- VERSION = 1.1 .0
1
+ VERSION = 1.2 .0
2
2
3
3
APP := http-file-server
4
4
PACKAGES := $(shell go list -f {{.Dir}} ./...)
Original file line number Diff line number Diff line change 6
6
7
7
## Contents
8
8
9
- <!-- TOC -->
10
-
11
9
- [ Contents] ( #contents )
12
10
- [ Examples] ( #examples )
13
11
- [ Get it] ( #get-it )
14
12
- [ Using ` go get ` ] ( #using-go-get )
15
13
- [ Pre-built binary] ( #pre-built-binary )
16
14
- [ Use it] ( #use-it )
17
15
18
- <!-- /TOC -->
19
-
20
-
21
16
## Examples
22
17
23
18
``` sh
@@ -27,6 +22,14 @@ $ http-file-server /tmp
27
22
2018/11/13 23:00:03.946093 http-file-server listening on " :8080"
28
23
```
29
24
25
+ ``` sh
26
+ $ cd /tmp
27
+ $ http-file-server
28
+ 2018/11/13 23:00:03.946051 serving local path " /tmp" on " /tmp/"
29
+ 2018/11/13 23:00:03.946087 redirecting to " /tmp/" from " /"
30
+ 2018/11/13 23:00:03.946093 http-file-server listening on " :8080"
31
+ ```
32
+
30
33
``` sh
31
34
$ http-file-server -p 1234 /1=/tmp /2=/var/tmp
32
35
2018/11/13 23:01:44.502240 serving local path " /tmp" on " /1/"
@@ -57,14 +60,14 @@ Or [download a binary](https://github.com/sgreben/http-file-server/releases/late
57
60
58
61
``` sh
59
62
# Linux
60
- curl -L https://github.com/sgreben/http-file-server/releases/download/1.1 .0/http-file-server_1.1 .0_linux_x86_64.tar.gz | tar xz
63
+ curl -L https://github.com/sgreben/http-file-server/releases/download/1.2 .0/http-file-server_1.2 .0_linux_x86_64.tar.gz | tar xz
61
64
62
65
# OS X
63
- curl -L https://github.com/sgreben/http-file-server/releases/download/1.1 .0/http-file-server_1.1 .0_osx_x86_64.tar.gz | tar xz
66
+ curl -L https://github.com/sgreben/http-file-server/releases/download/1.2 .0/http-file-server_1.2 .0_osx_x86_64.tar.gz | tar xz
64
67
65
68
# Windows
66
- curl -LO https://github.com/sgreben/http-file-server/releases/download/1.1 .0/http-file-server_1.1 .0_windows_x86_64.zip
67
- unzip versions_1.1 .0_windows_x86_64.zip
69
+ curl -LO https://github.com/sgreben/http-file-server/releases/download/1.2 .0/http-file-server_1.2 .0_windows_x86_64.zip
70
+ unzip versions_1.2 .0_windows_x86_64.zip
68
71
```
69
72
70
73
## Use it
Original file line number Diff line number Diff line change 6
6
7
7
## Contents
8
8
9
- <!-- TOC -->
10
-
11
9
- [ Contents] ( #contents )
12
10
- [ Examples] ( #examples )
13
11
- [ Get it] ( #get-it )
14
12
- [ Using ` go get ` ] ( #using-go-get )
15
13
- [ Pre-built binary] ( #pre-built-binary )
16
14
- [ Use it] ( #use-it )
17
15
18
- <!-- /TOC -->
19
-
20
-
21
16
## Examples
22
17
23
18
``` sh
@@ -27,6 +22,14 @@ $ http-file-server /tmp
27
22
2018/11/13 23:00:03.946093 http-file-server listening on " :8080"
28
23
```
29
24
25
+ ``` sh
26
+ $ cd /tmp
27
+ $ http-file-server
28
+ 2018/11/13 23:00:03.946051 serving local path " /tmp" on " /tmp/"
29
+ 2018/11/13 23:00:03.946087 redirecting to " /tmp/" from " /"
30
+ 2018/11/13 23:00:03.946093 http-file-server listening on " :8080"
31
+ ```
32
+
30
33
``` sh
31
34
$ http-file-server -p 1234 /1=/tmp /2=/var/tmp
32
35
2018/11/13 23:01:44.502240 serving local path " /tmp" on " /1/"
Original file line number Diff line number Diff line change @@ -72,8 +72,7 @@ func server(addr string, routes routes) error {
72
72
paths := make (map [string ]string )
73
73
74
74
if len (routes .Values ) == 0 {
75
- log .Printf ("WARNING: no routes specified - every request will return %d (%s)" , http .StatusNotFound , http .StatusText (http .StatusNotFound ))
76
- http .HandleFunc (rootRoute , http .NotFound )
75
+ routes .Set ("." )
77
76
}
78
77
79
78
for _ , route := range routes .Values {
You can’t perform that action at this time.
0 commit comments