@@ -23,7 +23,6 @@ import (
23
23
"path/filepath"
24
24
"regexp"
25
25
"sort"
26
- "strconv"
27
26
"strings"
28
27
"sync"
29
28
texttemplate "text/template"
@@ -106,7 +105,6 @@ func Run() error {
106
105
http .HandleFunc ("/.detail/" , serveDetail )
107
106
http .HandleFunc ("/.export" , serveExport )
108
107
http .HandleFunc ("/.help" , serveHelp )
109
- http .Handle ("/_/export" , http .RedirectHandler ("/.export" , http .StatusMovedPermanently ))
110
108
http .Handle ("/.static/" , http .StripPrefix ("/." , http .FileServer (http .FS (embeddedFS ))))
111
109
112
110
if * dev != "" {
@@ -237,7 +235,7 @@ func serveHome(w http.ResponseWriter, short string) {
237
235
})
238
236
}
239
237
240
- func serveHelp (w http.ResponseWriter , r * http.Request ) {
238
+ func serveHelp (w http.ResponseWriter , _ * http.Request ) {
241
239
helpTmpl .Execute (w , nil )
242
240
}
243
241
@@ -507,17 +505,12 @@ func serveSave(w http.ResponseWriter, r *http.Request) {
507
505
// serveExport prints a snapshot of the link database. Links are JSON encoded
508
506
// and printed one per line. This format is used to restore link snapshots on
509
507
// startup.
510
- func serveExport (w http.ResponseWriter , r * http.Request ) {
508
+ func serveExport (w http.ResponseWriter , _ * http.Request ) {
511
509
if err := flushStats (); err != nil {
512
510
http .Error (w , err .Error (), http .StatusInternalServerError )
513
511
return
514
512
}
515
513
516
- includeClicks := true
517
- if v := r .FormValue ("clicks" ); v != "" {
518
- includeClicks , _ = strconv .ParseBool (v )
519
- }
520
-
521
514
links , err := db .LoadAll ()
522
515
if err != nil {
523
516
http .Error (w , err .Error (), http .StatusInternalServerError )
@@ -528,9 +521,6 @@ func serveExport(w http.ResponseWriter, r *http.Request) {
528
521
})
529
522
encoder := json .NewEncoder (w )
530
523
for _ , link := range links {
531
- if ! includeClicks {
532
- link .Clicks = 0
533
- }
534
524
if err := encoder .Encode (link ); err != nil {
535
525
panic (http .ErrAbortHandler )
536
526
}
0 commit comments