mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-16 11:32:26 +01:00
23 lines
340 B
Go
23 lines
340 B
Go
package connector
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v3/client"
|
|
"time"
|
|
)
|
|
|
|
func RequestApi(path string) (*client.Response, error) {
|
|
|
|
var host = "http://localhost"
|
|
|
|
cc := client.New()
|
|
cc.SetTimeout(5 * time.Second)
|
|
|
|
// set retry to 0
|
|
response, err := cc.Get(host + path)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return response, nil
|
|
}
|