mahiatlinux commited on
Commit
64c5a0f
1 Parent(s): 72e20cd

Create server.py

Browse files
Files changed (1) hide show
  1. server.py +22 -0
server.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from http.server import HTTPServer, BaseHTTPRequestHandler
2
+
3
+ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
4
+ def do_GET(self):
5
+ self.send_response(200)
6
+ self.send_header('Content-type', 'text/plain')
7
+ self.end_headers()
8
+ self.wfile.write(b'Main Ollama bridge is running!')
9
+
10
+ def main():
11
+ # Set server address and port
12
+ server_address = ('0.0.0.0', 7860)
13
+
14
+ # Create an HTTP server
15
+ httpd = HTTPServer(server_address, SimpleHTTPRequestHandler)
16
+
17
+ # Start the server
18
+ print('Starting server on port 7860...')
19
+ httpd.serve_forever()
20
+
21
+ if __name__ == "__main__":
22
+ main()