From ad67099a4b332f227705dc6842874469841b4cae Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sun, 25 Apr 2021 16:49:32 +0530 Subject: added functionality to calculate the price after applying the discount on each product --- server/go.mod | 5 ++++- server/go.sum | 2 ++ server/main.go | 10 ++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/go.mod b/server/go.mod index 70699fa..c920659 100644 --- a/server/go.mod +++ b/server/go.mod @@ -2,4 +2,7 @@ module github.com/MikunoNaka/openbills go 1.16 -require github.com/gin-gonic/gin v1.7.1 // indirect +require ( + github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19 // indirect + github.com/gin-gonic/gin v1.7.1 // indirect +) diff --git a/server/go.sum b/server/go.sum index 00998d3..4952cd2 100644 --- a/server/go.sum +++ b/server/go.sum @@ -2,6 +2,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19 h1:J2LPEOcQmWaooBnBtUDV9KHFEnP5LYTZY03GiQ0oQBw= +github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19/go.mod h1:iqneQ2Df3omzIVTkIfn7c1acsVnMGiSLn4XF5Blh3Yg= github.com/gin-gonic/gin v1.7.1 h1:qC89GU3p8TvKWMAVhEpmpB2CIb1hnqt2UdKZaP93mS8= github.com/gin-gonic/gin v1.7.1/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= diff --git a/server/main.go b/server/main.go index b0d3f9d..9a84f7b 100644 --- a/server/main.go +++ b/server/main.go @@ -2,14 +2,16 @@ package main import ( "github.com/gin-gonic/gin" - // "net/http" + "github.com/gin-gonic/contrib/static" ) func main() { - myRouter := gin.New() - // myRouter.Use(gin.Logger()) + myRouter := gin.Default() + myRouter.Use(gin.Logger()) - myRouter.Static("/app", "./app") + // serve static front end on / + myRouter.Use(static.Serve("/", + static.LocalFile("./app", true))) myRouter.Run(":8080") } -- cgit v1.2.3