Skip to content

Commit deeb68d

Browse files
committed
Fix main.go
1 parent e2b1781 commit deeb68d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

api/cmd/loadtest/main.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@ import (
44
"context"
55
"fmt"
66
"log"
7+
"os"
8+
9+
"github.com/joho/godotenv"
710

811
"github.com/carlmjohnson/requests"
912
"github.com/palantir/stacktrace"
1013
)
1114

1215
func main() {
16+
err := godotenv.Load("../../.env")
17+
if err != nil {
18+
log.Fatal("Error loading .env file")
19+
}
20+
1321
for i := 0; i < 50; i++ {
1422
var responsePayload string
15-
err := requests.
23+
err = requests.
1624
URL("/v1/messages/send").
17-
Host("localhost:8000").
18-
Scheme("http").
19-
Header("x-api-key", "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xNe7sEB9HixkmBhVrYaB0NhtHpHgAWeTnL").
25+
Host("api.httpsms.com").
26+
// Host("localhost:8000").
27+
// Scheme("http").
28+
Header("x-api-key", os.Getenv("API_KEY")).
2029
BodyJSON(&map[string]string{
2130
"content": fmt.Sprintf("testing http api sample: [%d]", i),
2231
"from": "+37259139660",

0 commit comments

Comments
 (0)