Skip to content

Commit

Permalink
use reverse proxy for all requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ili16 committed Jan 2, 2024
1 parent 76465c8 commit f8f054a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/rwth-acis/modernizer

go 1.20
go 1.21

toolchain go1.21.5

require github.com/gin-gonic/gin v1.9.1

Expand Down
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package main

import (
"github.com/gin-gonic/gin"
"io"
"net/http"
"net/http/httputil"
"net/url"

"github.com/gin-gonic/gin"
)

var OllamaURL = "http://ollama-service.ba-kovacevic:11434"

func main() {
router := gin.Default()
router.GET("/", getInfo)
// router.GET("/", getInfo)

router.Any("/api/*proxyPath", proxy)
router.Any("/*proxyPath", proxy)

err := router.Run(":8080")
if err != nil {
Expand Down

0 comments on commit f8f054a

Please sign in to comment.