Spaces:
Sleeping
Sleeping
File size: 580 Bytes
b5b4a38 dfd3544 b5b4a38 dfd3544 b5b4a38 dfd3544 b5b4a38 dfd3544 b5b4a38 dfd3544 b5b4a38 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
package main
import (
"fmt"
"strings"
"github.com/Jensen-holm/ml-from-scratch/request"
"github.com/go-gota/gota/dataframe"
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
app.Post("/", func(c *fiber.Ctx) error {
r := new(request.Payload)
err := request.NewPayload(r, c)
if err != nil {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"error": "Invalid JSON data",
})
}
df := dataframe.ReadCSV(strings.NewReader(r.CSVData))
r.SetDf(df)
fmt.Println(r.Df)
return c.SendString("No error")
})
app.Listen(":3000")
}
|