redo s3 script and create s3 function
This commit is contained in:
parent
464c9bd8c9
commit
bd671f4cde
2 changed files with 18 additions and 1 deletions
|
@ -49,7 +49,7 @@ function createFile(files: S3File[]) {
|
||||||
// run \`vr s3\` to regenerate this File
|
// run \`vr s3\` to regenerate this File
|
||||||
|
|
||||||
const S3Files = [
|
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
|
export default S3Files
|
||||||
|
|
17
src/routes/api/functions/s3.ts
Normal file
17
src/routes/api/functions/s3.ts
Normal 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" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue