Paweł Łaba commited on
Commit
165aa59
·
1 Parent(s): 29900b1
Files changed (2) hide show
  1. app.py +2 -2
  2. public/script.js +1 -1
app.py CHANGED
@@ -67,7 +67,7 @@ async def read_root():
67
  return HTMLResponse(content="Plik index.html nie został znaleziony", status_code=404)
68
 
69
 
70
- @app.get("/api/status")
71
  async def get_status():
72
  print("Endpoint /status został wywołany.")
73
  return JSONResponse({
@@ -77,7 +77,7 @@ async def get_status():
77
  })
78
 
79
 
80
- @app.post("/api/move")
81
  async def get_move(request: Request):
82
  """
83
  Endpoint do wykonania ruchu AI
 
67
  return HTMLResponse(content="Plik index.html nie został znaleziony", status_code=404)
68
 
69
 
70
+ @app.get("/status")
71
  async def get_status():
72
  print("Endpoint /status został wywołany.")
73
  return JSONResponse({
 
77
  })
78
 
79
 
80
+ @app.post("/move")
81
  async def get_move(request: Request):
82
  """
83
  Endpoint do wykonania ruchu AI
public/script.js CHANGED
@@ -7,7 +7,7 @@ for(let i = 0; i < 10; i++) {
7
  $('.board').appendChild(div);
8
  }
9
 
10
- fetch('api/status')
11
  .then(res => res.json())
12
  .then(data => {
13
  console.log(data);
 
7
  $('.board').appendChild(div);
8
  }
9
 
10
+ fetch('/status')
11
  .then(res => res.json())
12
  .then(data => {
13
  console.log(data);