-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from DeCenterAI-1/hiro/feat-darts
feat/fix: /api/darts
- Loading branch information
Showing
8 changed files
with
202 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
b: | ||
bun run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
### Options | ||
OPTIONS {{u}}/darts | ||
### | ||
|
||
POST {{u}}/api/darts | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "cowsay", | ||
"version": "v0.1.3", | ||
"inputs": { | ||
"Message": "Hi from vite dev " | ||
} | ||
} | ||
|
||
HTTP/1.1 500 - Internal Server Error | ||
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch | ||
content-type: application/json | ||
date: Thu, 27 Feb 2025 01:42:39 GMT | ||
connection: close | ||
transfer-encoding: chunked | ||
### | ||
|
||
POST {{u}}/api/darts | ||
Content-Type: application/json | ||
### | ||
|
||
POST https://darts.decenterai.com:8080/darts | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "cowsay", | ||
"version": "v0.1.3", | ||
"inputs": { | ||
"Message": "Hi from vite dev " | ||
} | ||
} | ||
|
||
HTTP/1.1 500 - Internal Server Error | ||
server: nginx | ||
date: Thu, 27 Feb 2025 01:40:25 GMT | ||
content-type: application/json | ||
content-length: 560 | ||
connection: close | ||
access-control-allow-origin: * | ||
strict-transport-security: max-age=31536000; includeSubDomains; preload | ||
### | ||
POST {{u}}/darts | ||
Authorization: Bearer 0xa618896c28db371a21f9d805c25e622425319d85684a1f9478568509a3f3f4a9 | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "cowsay", | ||
"version": "v0.1.3", | ||
"inputs": { | ||
"Message": "Hi from vite dev " | ||
} | ||
} | ||
|
||
HTTP/1.1 500 - Internal Server Error | ||
access-control-allow-origin: * | ||
content-length: 144 | ||
content-type: application/json | ||
date: Sun, 12 Jan 2025 20:41:15 GMT | ||
connection: close | ||
### | ||
POST {{u}}/darts | ||
Authorization: Bearer 0xa618896c28db371a21f9d805c25e622425319d85684a1f9478568509a3f3f4a9 | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "github.com/darts2024/dart-isdxl", | ||
"version": "v1.6.0", | ||
"inputs": { | ||
"Prompt": "Beautiful girl", | ||
"Device": "xpu", | ||
"cpu": "20", | ||
"ram": "22gb", | ||
"Seed": "{{$randomInt 1 10000000}}", | ||
"N":1 | ||
}, | ||
"author": "e260b0ab-9867-4507-97be-976779c20c9f" | ||
} | ||
|
||
HTTP/1.1 404 - Not Found | ||
cache-control: no-store, must-revalidate | ||
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding | ||
x-powered-by: Next.js | ||
content-type: text/html; charset=utf-8 | ||
content-encoding: gzip | ||
date: Thu, 27 Feb 2025 02:05:32 GMT | ||
connection: close | ||
transfer-encoding: chunked | ||
### | ||
|
||
POST {{u}}/darts | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "github.com/darts2024/dart-isdxl", | ||
"version": "v1.3.0", | ||
"inputs": { | ||
"Prompt": "Beautiful girl", | ||
"Device": "xpu", | ||
"Seed": "{{$randomInt 1 10000000}}" | ||
} | ||
} | ||
|
||
HTTP/1.1 500 - Internal Server Error | ||
access-control-allow-origin: * | ||
content-length: 204 | ||
content-type: application/json | ||
date: Sun, 12 Jan 2025 20:42:37 GMT | ||
connection: close | ||
### | ||
|
||
POST {{u}}/api/darts | ||
Authorization: Bearer 0xa618896c28db371a21f9d805c25e622425319d85684a1f9478568509a3f3f4a9 | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "github.com/darts2024/dart-isdxl", | ||
"version": "v1.6.0", | ||
"inputs": { | ||
"Prompt": "Beautiful girl", | ||
"Device": "xpu", | ||
"Seed": "{{$randomInt 1 10000000}}" | ||
} | ||
} | ||
|
||
HTTP/1.1 200 - OK | ||
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch | ||
content-type: application/json | ||
date: Thu, 27 Feb 2025 02:08:56 GMT | ||
connection: close | ||
transfer-encoding: chunked | ||
### | ||
|
||
POST {{u}}/api/darts | ||
Content-Type: application/json | ||
|
||
{ | ||
"module": "cowsay", | ||
"version": "v0.1.3", | ||
"inputs": { | ||
"Message": "Hi from vite dev " | ||
} | ||
} | ||
|
||
HTTP/1.1 500 - Internal Server Error | ||
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch | ||
content-type: application/json | ||
date: Thu, 27 Feb 2025 02:07:10 GMT | ||
connection: close | ||
transfer-encoding: chunked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
import axios from "axios"; | ||
import https from "https"; | ||
|
||
|
||
const agent = new https.Agent({ | ||
rejectUnauthorized: false, // Disable SSL verification | ||
ca: `-----BEGIN CERTIFICATE----- | ||
MIIDtTCCAp2gAwIBAgIUOtTgT7SuAS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VjmDyL+3o4h0UEgYDhWMGMl0iILmKGBQ7qnfMy3nsgDy | ||
Y7n1LfRMuwwZcNzTrq4OjpKBjAKPZMy1NZR9cuMEw+fVQOiM4afdsJSt/DOl+aY2 | ||
XmIP1S6gHygY805JVAjoGlEv4SYgsJt97/61xZgWZQh8N3PSFn1zR3lbZ3JpDLN2 | ||
lQ7Ghuq6/cFOhwmhdh2zUf8x/N8lzzeZqPdy3DYVGPmPyKOAPRsq69s= | ||
-----END CERTIFICATE-----`.trim() | ||
}); | ||
|
||
export const axiosInstance = axios.create({ | ||
baseURL: "https://darts.decenterai.com:8080", // Base URL | ||
// baseURL: "https://darts.decenterai.com:8080", // Base URL | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
httpsAgent: new https.Agent({ rejectUnauthorized: false }), // Allow self-signed SSL | ||
httpsAgent: agent, // Allow self-signed SSL | ||
}); | ||
|
||
export const axiosInstanceLocal = axios.create({ | ||
baseURL: "/", | ||
headers: { "Content-Type": "application/json" }, | ||
// httpsAgent: agent, // Allow self-signed SSL | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters