UPD api endpoints for upload and download

This commit is contained in:
Shaun Orssaud 2023-11-17 15:22:43 +09:00
parent 8368c46020
commit 8b3b7adad3
3 changed files with 3 additions and 3 deletions

View File

@ -7,6 +7,6 @@ services:
ports: ports:
- "3000:80" - "3000:80"
environment: environment:
- codex_url=http://host.docker.internal:8080 - codex_url=http://kubernetes.docker.internal:31942
volumes: volumes:
- ./deployment/nginx.template:/etc/nginx/templates/10-variables.conf.template:ro - ./deployment/nginx.template:/etc/nginx/templates/10-variables.conf.template:ro

View File

@ -12,7 +12,7 @@ function DownloadTab() {
console.log(filename); console.log(filename);
console.log(cid); console.log(cid);
fetch( fetch(
`/api/codex/v1/content/${cid}`, `/api/codex/v1/data/${cid}`,
{ {
headers: headers:
(nodeInfo.auth !== null && { (nodeInfo.auth !== null && {

View File

@ -44,7 +44,7 @@ function UploadTab() {
var newCid = ""; var newCid = "";
try { try {
await axios await axios
.post(`/api/codex/v1/content`, bytes, { .post(`/api/codex/v1/data`, bytes, {
headers: (nodeInfo.auth !== null && { headers: (nodeInfo.auth !== null && {
"Base-Url": nodeInfo.nodeToConnectTo || nodeInfo.baseUrl, "Base-Url": nodeInfo.nodeToConnectTo || nodeInfo.baseUrl,
"Content-Type": "application/octet-stream", "Content-Type": "application/octet-stream",