Skip to content

Commit

Permalink
[housekeeping] fix DIR_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
lispyclouds committed Aug 14, 2024
1 parent aa5137a commit e1dc759
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a simple artifact store enabling Bob to store build artifacts.

#### Requirements
- [Go](https://golang.org/dl/) 1.18+
- [Go](https://golang.org/dl/) 1.22+

#### Running
- `go build main.go` to compile the code and obtain a binary `main`.
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"path/filepath"
)

const DIR_NAME = "artifacts"

func ping(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Ack")
}
Expand Down Expand Up @@ -71,7 +73,7 @@ func delete(w http.ResponseWriter, r *http.Request) {
}

func send(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filepath.Join("artifacts", r.PathValue("artifactPath")))
http.ServeFile(w, r, filepath.Join(DIR_NAME, r.PathValue("artifactPath")))
}

func main() {
Expand Down

0 comments on commit e1dc759

Please sign in to comment.