mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 14:18:43 +08:00
dev: puterjs exec module
This commit is contained in:
parent
77d6bb2d8c
commit
cbe02a4489
@ -44,17 +44,22 @@ class Judge0Client {
|
||||
path = `/${path}`;
|
||||
}
|
||||
|
||||
const resp = await axios.request({
|
||||
method: 'POST',
|
||||
url: `${this.baseURL}${path}`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data,
|
||||
});
|
||||
try {
|
||||
const resp = await axios.request({
|
||||
method: 'POST',
|
||||
url: `${this.baseURL}${path}`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data,
|
||||
});
|
||||
|
||||
return resp.data;
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
console.error('error response', e.response.data);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,6 +216,7 @@ class DriverService extends BaseService {
|
||||
['puter-tts']: 'aws-polly',
|
||||
['puter-chat-completion']: 'openai-completion',
|
||||
['puter-image-generation']: 'openai-image-generation',
|
||||
'puter-exec': 'judge0',
|
||||
'puter-apps': 'es:app',
|
||||
'puter-subdomains': 'es:subdomain',
|
||||
'puter-notifications': 'es:notification',
|
||||
|
@ -23,6 +23,7 @@ import { PSocket, wispInfo } from './modules/networking/PSocket.js';
|
||||
import { PTLSSocket } from "./modules/networking/PTLS.js"
|
||||
import { PWispHandler } from './modules/networking/PWispHandler.js';
|
||||
import { make_http_api } from './lib/http.js';
|
||||
import Exec from './modules/Exec.js';
|
||||
|
||||
// TODO: This is for a safe-guard below; we should check if we can
|
||||
// generalize this behavior rather than hard-coding it.
|
||||
@ -98,6 +99,7 @@ window.puter = (function() {
|
||||
this.registerModule('kv', KV);
|
||||
this.registerModule('drivers', Drivers);
|
||||
this.registerModule('debug', Debug);
|
||||
this.registerModule('exec', Exec);
|
||||
|
||||
// Path
|
||||
this.path = path;
|
||||
|
Loading…
Reference in New Issue
Block a user