File tree 4 files changed +29
-1
lines changed
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
clone /
2
+ webui /
2
3
pkged.go
3
4
4
5
# Junk files
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ generate: clone
15
15
rm -rf clone/build/locales/[a-d]* clone/build/locales/[f-zR]*
16
16
find clone/build \( -name " *.map" -or -name " *.eot" -or -name " *.woff" -or -name " *.woff2" -or -name " *.otf" \) -delete
17
17
du -hs clone/build
18
+ mv clone/build webui
18
19
# pack
19
- pkger -include /clone/build
20
+ rm -f pkged.go
21
+ pkger
20
22
21
23
.PHONY : release
22
24
release : generate
Original file line number Diff line number Diff line change
1
+ package ipfswebui
2
+
3
+ import "github.com/markbates/pkger"
4
+
5
+ func Dir () pkger.Dir {
6
+ return pkger .Dir ("/webui" )
7
+ }
Original file line number Diff line number Diff line change
1
+ package ipfswebui_test
2
+
3
+ import (
4
+ "fmt"
5
+ "net/http"
6
+
7
+ ipfswebui "berty.tech/ipfs-webui-packed"
8
+ )
9
+
10
+ func Example () {
11
+ fmt .Println (ipfswebui .Dir ())
12
+ // output: /webui
13
+ }
14
+
15
+ func Example_http () {
16
+ dir := http .FileServer (ipfswebui .Dir ())
17
+ http .ListenAndServe (":3000" , dir )
18
+ }
You can’t perform that action at this time.
0 commit comments