christopher commited on
Commit
d46499b
·
1 Parent(s): c2da793

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -2
app.py CHANGED
@@ -1,7 +1,35 @@
1
  from fastapi import FastAPI
 
2
 
3
  app = FastAPI()
4
 
5
- @app.get("/")
6
  def read_root():
7
- return {"Hello": "World!"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from fastapi import FastAPI
2
+ from fastapi.responses import HTMLResponse
3
 
4
  app = FastAPI()
5
 
6
+ @app.get("/", response_class=HTMLResponse)
7
  def read_root():
8
+ return """
9
+ <!DOCTYPE html>
10
+ <html>
11
+ <head>
12
+ <title>Chess Position Search</title>
13
+ <link rel="stylesheet"
14
+ href="https://unpkg.com/@lichess-org/chessground/dist/chessground.css">
15
+ <style>
16
+ body { font-family: Arial; max-width: 1200px; margin: 0 auto; padding: 20px; }
17
+ #board { width: 512px; height: 512px; }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <h1>Chess Position Search</h1>
22
+ <div id="board"></div>
23
+
24
+ <script type="module">
25
+ import { Chessground } from 'https://unpkg.com/@lichess-org/chessground/dist/chessground.js';
26
+
27
+ const board = Chessground(document.getElementById('board'), {
28
+ movable: { free: true, color: 'both' },
29
+ draggable: { enabled: true },
30
+ fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR'
31
+ });
32
+ </script>
33
+ </body>
34
+ </html>
35
+ """