🚧 working on submitting form

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2024-01-07 13:59:07 +01:00
parent e3a6ff55b4
commit 6a3f5cf825
4 changed files with 42 additions and 6 deletions

View file

@ -23,7 +23,7 @@ func main() {
router.Use(cors.Default())
// Info about user
router.POST("/submitform", func(c *gin.Context) {
router.POST("/submituserform", func(c *gin.Context) {
var requestBody FormData
@ -65,6 +65,14 @@ func main() {
c.JSON(http.StatusOK, gin.H{"questions": questions})
})
router.POST("/submitanswers", func(c *gin.Context) {
var requestBody FormData
if err := c.BindJSON(&requestBody); err != nil {
fmt.Print(err)
}
})
// Run the server on port 8080
router.Run(":8080")
//db.SetupDb()