Files
p2p-rendering-computation/server/server.go
2021-03-08 09:17:44 +04:00

37 lines
745 B
Go

package server
import (
"github.com/gin-gonic/gin"
"net/http"
//"fmt"
)
func Server() {
r := gin.Default()
// Gets default information of the server
r.GET("/server_info", func(c *gin.Context) {
c.JSON(http.StatusOK, ServerInfo())
})
/*r.GET("/create_vm/:virtualization", func(c *gin.Context) {
virtualization := c.Param("virtualization")
// Runs based on Preallocated VM size
if virtualization == "docker" {
sshinfo,err := docker.RunVM()
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
}
if sshinfo != nil {
c.JSON(http.StatusOK, sshinfo)
}
} else {
c.String(200,"virtualization tool not selected")
}
})*/
// Port running on
r.Run(":8088")
}