fix and callable s3 function
This commit is contained in:
parent
73626cf31a
commit
72c5fe3519
2 changed files with 12 additions and 7 deletions
|
@ -4,12 +4,17 @@ export default {
|
||||||
method: ["*"],
|
method: ["*"],
|
||||||
domains: ["*"],
|
domains: ["*"],
|
||||||
handler: async (r: pogo.Request, h: pogo.Toolkit) => {
|
handler: async (r: pogo.Request, h: pogo.Toolkit) => {
|
||||||
console.log("searchParams", r.searchParams)
|
|
||||||
if ((r.searchParams.get("token")) === Deno.env.get("TOKEN")) {
|
if ((r.searchParams.get("token")) === Deno.env.get("TOKEN")) {
|
||||||
await Deno.run({
|
try {
|
||||||
cmd: ["ls"]
|
const sss = await Deno.run({
|
||||||
|
cmd: ["deno", "run", "-A", "--unstable", "./scripts/s3.ts"]
|
||||||
})
|
})
|
||||||
return { "yes": "yes" }
|
const status = sss.status()
|
||||||
|
|
||||||
|
return { "yes": "yes", status }
|
||||||
|
} catch (error) {
|
||||||
|
return error
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return { "no": "no" }
|
return { "no": "no" }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { pogo } from "../../../deps.ts"
|
import { pogo } from "../../../deps.ts"
|
||||||
import S3Files from "../../s3.generated.ts"
|
import S3Files from "../../generated/s3.ts"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
method: ["*"],
|
method: ["*"],
|
||||||
domains: ["dreamland.lio.systems"],
|
domains: ["dreamland.lio.systems", "localhost:3000"],
|
||||||
handler: (r: pogo.Request, h: pogo.Toolkit) => {
|
handler: (r: pogo.Request, h: pogo.Toolkit) => {
|
||||||
return S3Files
|
return S3Files
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue