blob: 2b6512be5fd4cfa6eb3740634dca3d2f1e951c4c [file] [log] [blame]
Filip Tehlar229f5fc2022-08-09 14:44:47 +00001package main
2
3import (
4 "fmt"
5 "io"
6 "net/http"
7 "os"
8)
9
10func main() {
11 if len(os.Args) < 2 {
12 fmt.Println("arg expected")
13 os.Exit(1)
14 }
15
16 http.HandleFunc("/10M", func(w http.ResponseWriter, r *http.Request) {
17 file, _ := os.Open("10M")
18 defer file.Close()
19 io.Copy(w, file)
20 })
21 err := http.ListenAndServe(os.Args[1], nil)
22 if err != nil {
23 fmt.Printf("%v\n", err)
24 os.Exit(1)
25 }
26}