mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-18 12:32:26 +01:00
feat:#7 extracted ical-service in own microservice
This commit is contained in:
22
backend-ical/service/connector/restHandler.go
Normal file
22
backend-ical/service/connector/restHandler.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user