fix and callable s3 function

This commit is contained in:
Joshua 2022-09-21 22:19:09 +02:00
parent 73626cf31a
commit 72c5fe3519
2 changed files with 12 additions and 7 deletions

View file

@ -4,12 +4,17 @@ export default {
method: ["*"],
domains: ["*"],
handler: async (r: pogo.Request, h: pogo.Toolkit) => {
console.log("searchParams", r.searchParams)
if ((r.searchParams.get("token")) === Deno.env.get("TOKEN")) {
await Deno.run({
cmd: ["ls"]
})
return { "yes": "yes" }
try {
const sss = await Deno.run({
cmd: ["deno", "run", "-A", "--unstable", "./scripts/s3.ts"]
})
const status = sss.status()
return { "yes": "yes", status }
} catch (error) {
return error
}
} else {
return { "no": "no" }
}

View file

@ -1,9 +1,9 @@
import { pogo } from "../../../deps.ts"
import S3Files from "../../s3.generated.ts"
import S3Files from "../../generated/s3.ts"
export default {
method: ["*"],
domains: ["dreamland.lio.systems"],
domains: ["dreamland.lio.systems", "localhost:3000"],
handler: (r: pogo.Request, h: pogo.Toolkit) => {
return S3Files