add basic /
route for server
This commit is contained in:
parent
ea809df196
commit
74e92d1258
1 changed files with 4 additions and 0 deletions
|
@ -125,6 +125,10 @@ func generate(c *gin.Context) {
|
||||||
func Serve(ln net.Listener) error {
|
func Serve(ln net.Listener) error {
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
|
||||||
|
r.GET("/", func(c *gin.Context) {
|
||||||
|
c.String(http.StatusOK, "Ollama is running")
|
||||||
|
})
|
||||||
|
|
||||||
r.POST("api/pull", func(c *gin.Context) {
|
r.POST("api/pull", func(c *gin.Context) {
|
||||||
var req api.PullRequest
|
var req api.PullRequest
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue