Skip to content

Commit

Permalink
Init upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kverma authored Jun 30, 2016
1 parent d72b1b1 commit aec308b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package main

import (
"flag"
"fmt"
"net/http"
//"os"
)

func main() {

// Get current working directory to get the file from it
/* cwd, err := os.Getwd()
if err != nil {
fmt.Printf("Error while getting current directory.")
return
}
*/
// Command line parsing
bind := flag.String("bind", ":80", "Bind address")
// root_folder := flag.String("root", cwd, "Root folder")

flag.Parse()

fileServer := http.FileServer(http.Dir("."))
fmt.Printf("Sharing current directory on %s ...\n", *bind)
http.ListenAndServe((*bind), fileServer)

}

0 comments on commit aec308b

Please sign in to comment.