sujalrajpoot commited on
Commit
f383954
·
verified ·
1 Parent(s): 831c92b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -56
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from flask import Flask, request, jsonify, render_template_string
2
  import hmac, hashlib, secrets, time
3
  from openai import OpenAI
4
  import os
@@ -17,66 +17,18 @@ start_time = time.time()
17
 
18
  @app.route('/')
19
  def home():
20
- uptime_seconds = int(time.time() - start_time)
21
- days, hours, minutes, seconds = (
22
- uptime_seconds // 86400,
23
- (uptime_seconds % 86400) // 3600,
24
- (uptime_seconds % 3600) // 60,
25
- uptime_seconds % 60,
26
- )
27
-
28
- uptime_str = f"{days} days, {hours} hours, {minutes} minutes and {seconds} seconds"
29
-
30
- html_template = """
31
- <!DOCTYPE html>
32
- <html lang="en">
33
  <head>
34
- <meta charset="UTF-8">
35
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
36
- <title>TrueSyncAI API</title>
37
- <style>
38
- body {
39
- font-family: Arial, sans-serif;
40
- text-align: center;
41
- background-color: #f4f4f4;
42
- padding: 40px;
43
- }
44
- .container {
45
- background: white;
46
- padding: 20px;
47
- border-radius: 10px;
48
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
49
- max-width: 500px;
50
- margin: auto;
51
- }
52
- img {
53
- width: 100%;
54
- max-width: 400px;
55
- border-radius: 10px;
56
- }
57
- h1 {
58
- color: #333;
59
- }
60
- p {
61
- font-size: 18px;
62
- color: #555;
63
- }
64
- </style>
65
  </head>
66
- <body>
67
- <div class="container">
68
- <img src="https://huggingface.co/spaces/sujalrajpoot/truesyncai/resolve/main/TrueSyncAI.jpg" alt="TrueSyncAI Logo">
69
- <h1>TrueSyncAI API</h1>
70
- <p><strong>Status:</strong> API is running</p>
71
- <p><strong>Total Requests:</strong> {{ total_requests }}</p>
72
- <p><strong>Uptime:</strong> {{ uptime }}</p>
73
- </div>
74
  </body>
75
  </html>
76
  """
77
-
78
- return render_template_string(html_template, total_requests=request_count, uptime=uptime_str)
79
-
80
  @app.route('/status', methods=['GET'])
81
  def status():
82
  global request_count
 
1
+ from flask import Flask, request, jsonify, redirect, url_for
2
  import hmac, hashlib, secrets, time
3
  from openai import OpenAI
4
  import os
 
17
 
18
  @app.route('/')
19
  def home():
20
+ return """
21
+ <html>
 
 
 
 
 
 
 
 
 
 
 
22
  <head>
23
+ <title>TrueSyncAI</title>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </head>
25
+ <body style="text-align: center;">
26
+ <h1>Welcome to TrueSyncAI</h1>
27
+ <img src="https://huggingface.co/spaces/sujalrajpoot/truesyncai/resolve/main/TrueSyncAI.jpg" alt="TrueSyncAI Logo" width="500">
 
 
 
 
 
28
  </body>
29
  </html>
30
  """
31
+
 
 
32
  @app.route('/status', methods=['GET'])
33
  def status():
34
  global request_count