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: ["*"],
|
||||
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" }
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue