redo s3 script and create s3 function

This commit is contained in:
Joshua 2022-09-19 22:21:21 +02:00
parent 464c9bd8c9
commit bd671f4cde
2 changed files with 18 additions and 1 deletions

View file

@ -49,7 +49,7 @@ function createFile(files: S3File[]) {
// run \`vr s3\` to regenerate this File
const S3Files = [
${files.map(file => (`{ key: "${file.key}", url: "${file.url}" }`)).join(",\n ")}
${files.map(file => (`{ "${file.key}" : "${file.url}" }`)).join(",\n ")}
]
export default S3Files

View file

@ -0,0 +1,17 @@
import { pogo } from "../../../../deps.ts"
export default {
method: ["*"],
domains: ["*"],
handler: async (r: pogo.Request, h: pogo.Toolkit) => {
console.log(r.searchParams)
if (r.searchParams.get("token") === Deno.env.get("TOKEN")) {
await Deno.run({
cmd: ["ls"]
})
return { "yes": "yes" }
} else {
return { "no": "no" }
}
}
}