package main

import (
	"fmt"
	"net/http"
	"os"

	"github.com/gin-gonic/gin"
)

func RunServer() {
	r := gin.Default()

	r.GET("/ping", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"message": "pong",
		})
	})

	r.GET("/storj", func(c *gin.Context) {
		_, err := GetBucketData()
		if err != nil {
			fmt.Printf("Error: %v", err)
			return
		}
	})
	r.Run(os.Getenv("HOST_ADDRESS") + ":3001")
}