Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
74e92d12
Commit
74e92d12
authored
Jul 07, 2023
by
Jeffrey Morgan
Browse files
add basic `/` route for server
parent
ea809df1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
server/routes.go
server/routes.go
+4
-0
No files found.
server/routes.go
View file @
74e92d12
...
@@ -125,6 +125,10 @@ func generate(c *gin.Context) {
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment