Added create docker image route and intergrated with the client

This commit is contained in:
2021-04-02 02:33:16 +04:00
parent a7dc4cbce4
commit 53ba23ebf9
11 changed files with 172 additions and 55 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
"fmt"
"git.sr.ht/~akilan1999/p2p-rendering-computation/server/docker"
"github.com/gin-gonic/gin"
"net/http"
//"fmt"
@@ -31,7 +32,18 @@ func Server() {
})
r.GET("/startcontainer", func(c *gin.Context) {
resp, err := docker.BuildRunContainer()
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
}
c.JSON(http.StatusOK, resp)
})
// Future feature
/*r.GET("/create_vm/:virtualization", func(c *gin.Context) {
virtualization := c.Param("virtualization")
// Runs based on Preallocated VM size