mirror of
https://github.com/codex-storage/codex-frontend.git
synced 2025-03-01 02:30:49 +00:00
Python API works now
This commit is contained in:
parent
033c3e7437
commit
30692fe0db
@ -10,6 +10,15 @@ CORS(app)
|
||||
def root():
|
||||
return jsonify({'message': 'Welcome to the API!'})
|
||||
|
||||
@app.route('/debug')
|
||||
def debug():
|
||||
base_url = request.headers.get('Base-Url')
|
||||
response = requests.get(
|
||||
f'{base_url}/api/codex/v1/debug/info'
|
||||
)
|
||||
print(response.status_code)
|
||||
print(response.text)
|
||||
return response.text
|
||||
|
||||
@app.route('/upload', methods=['POST'])
|
||||
def upload():
|
||||
|
@ -15,8 +15,4 @@ server {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
location /uploads {
|
||||
proxy_pass http://localhost:5000;
|
||||
}
|
||||
}
|
@ -4,7 +4,8 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile.api
|
||||
image: codex-frontend-api
|
||||
network_mode: "host"
|
||||
ports:
|
||||
- "5000:5000"
|
||||
client:
|
||||
build:
|
||||
context: .
|
||||
|
@ -1 +1 @@
|
||||
REACT_APP_CODEX_URL=http://localhost:8080
|
||||
REACT_APP_CODEX_URL=http://host.docker.internal:8080
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
import NodeInfoItemComponent from "../../components/nodeInfoItem/NodeInfoItemComponent";
|
||||
import Header from "../../components/layout/partials/Header";
|
||||
import { useDexyStore } from "../../store";
|
||||
import constants from "../../util/Constants";
|
||||
|
||||
function DebugPage() {
|
||||
const { nodeInfo } = useDexyStore();
|
||||
@ -15,20 +16,15 @@ function DebugPage() {
|
||||
const [statusInfo, setStatusInfo] = React.useState<
|
||||
DebugNodeInfoModel | undefined
|
||||
>();
|
||||
|
||||
useEffect(() => {
|
||||
axios
|
||||
.get(
|
||||
`${
|
||||
nodeInfo.nodeToConnectTo || nodeInfo.baseUrl
|
||||
}/api/codex/v1/debug/info`,
|
||||
`${constants.testApiBaseUrl}/debug`,
|
||||
{
|
||||
headers:
|
||||
(nodeInfo.auth !== null && {
|
||||
Authorization:
|
||||
(nodeInfo.auth && "Basic " + btoa(nodeInfo.auth)) || "",
|
||||
}) ||
|
||||
{},
|
||||
({
|
||||
"Base-Url": nodeInfo.baseUrl,
|
||||
}),
|
||||
}
|
||||
)
|
||||
.then((response) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user