Merge pull request 'Better import packaging' (#7) from better_packaging into main
Reviewed-on: http://192.168.178.135:3000/Fabelous/Go_server_w_argos_translate/pulls/7
This commit is contained in:
commit
f89fbd2ce6
|
@ -5,7 +5,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -35,7 +35,7 @@ func getAllPackages() {
|
||||||
}
|
}
|
||||||
func handleRequest(w http.ResponseWriter, r *http.Request) {
|
func handleRequest(w http.ResponseWriter, r *http.Request) {
|
||||||
// Read the request body
|
// Read the request body
|
||||||
body, err := ioutil.ReadAll(r.Body)
|
body, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "Error reading request body: "+err.Error(), http.StatusInternalServerError)
|
http.Error(w, "Error reading request body: "+err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue