mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 22:05:13 +00:00
Remove rogue JSON.parse
This commit is contained in:
parent
3103294d0e
commit
1a9e592326
3 changed files with 4 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
.env
|
||||
.vercel
|
||||
.vercel
|
||||
.vscode
|
||||
|
|
|
|||
|
|
@ -61,13 +61,13 @@ export default async (req: ServerRequest) => {
|
|||
const { pathname } = urlParse(url)
|
||||
const filename = index + pathname.substr(pathname.lastIndexOf('/') + 1)
|
||||
|
||||
const res = JSON.parse(await (await fetch("https://cdn.hackclub.com/api/newSingle", {
|
||||
const res = await (await fetch("https://cdn.hackclub.com/api/newSingle", {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: url
|
||||
})).json())
|
||||
})).json()
|
||||
|
||||
res.file = 'public/' + filename
|
||||
res.path = filename
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { ServerRequest } from 'https://deno.land/std@0.75.0/http/server.ts'
|
||||
import { Hash } from "https://deno.land/x/checksum@1.4.0/mod.ts"
|
||||
import { urlParse } from 'https://deno.land/x/url_parse/mod.ts';
|
||||
|
||||
const endpoint = (path: string) => {
|
||||
// https://vercel.com/docs/api#api-basics/authentication/accessing-resources-owned-by-a-team
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue