This commit is contained in:
@@ -9,7 +9,7 @@ cmd = "go build -o ./tmp/marka-server ./cmd/marka-server"
|
|||||||
bin = "./tmp/marka-server"
|
bin = "./tmp/marka-server"
|
||||||
|
|
||||||
# Command to run the application with arguments.
|
# Command to run the application with arguments.
|
||||||
full_bin = "./tmp/marka-server -root=/home/max/Notes/resources -addr=:8080 -playground-root=./playground"
|
full_bin = "MARKA_API_KEY='SECRET' ./tmp/marka-server -root=/home/max/Notes/resources -addr=:8080 -playground-root=./playground"
|
||||||
|
|
||||||
# Watch these file extensions.
|
# Watch these file extensions.
|
||||||
include_ext = ["go", "http"]
|
include_ext = ["go", "http"]
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -62,6 +63,7 @@ func main() {
|
|||||||
must(err)
|
must(err)
|
||||||
|
|
||||||
apiKey := os.Getenv("MARKA_API_KEY")
|
apiKey := os.Getenv("MARKA_API_KEY")
|
||||||
|
fmt.Println(apiKey)
|
||||||
http.Handle("/", handler.NewHandler(fsAdapter, apiKey))
|
http.Handle("/", handler.NewHandler(fsAdapter, apiKey))
|
||||||
|
|
||||||
log.Printf("listening on %s, roots=%s", *addr, strings.Join(absRoots, ", "))
|
log.Printf("listening on %s, roots=%s", *addr, strings.Join(absRoots, ", "))
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ func (h *Handler) post(w http.ResponseWriter, r *http.Request, target string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
writeJSON(w, http.StatusOK, map[string]any{"success": true})
|
writeJSON(w, http.StatusOK, map[string]any{"success": true})
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user