Skip to content

Commit

Permalink
chore: use Response.redirect
Browse files Browse the repository at this point in the history
chore: bump (dev)Dependencies
  • Loading branch information
JounQin committed Oct 27, 2023
1 parent 1ba3ae0 commit 7ca5e03
Show file tree
Hide file tree
Showing 4 changed files with 4,263 additions and 5,356 deletions.
8 changes: 1 addition & 7 deletions api/[owner]/[app]/[version].ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface DownloadInfo {
download_url: string
}

const REDIRECT = 302
const NOT_FOUND = 404

export const config = {
Expand Down Expand Up @@ -59,10 +58,5 @@ export default async (req: Request): Promise<Response> => {

console.log(`Redirect to ${downloadUrl}`)

return new Response(null, {
status: REDIRECT,
headers: {
Location: downloadUrl,
},
})
return Response.redirect(downloadUrl)
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
"start": "vc dev"
},
"dependencies": {
"@vercel/edge": "^0.3.1"
"@vercel/edge": "^1.1.0"
},
"devDependencies": {
"@1stg/common-config": "^7.2.0",
"@octokit/request": "^6.2.3",
"@types/web": "^0.0.99",
"tsx": "^3.12.6",
"typescript": "^5.0.2",
"vercel": "^28.18.2",
"yarn-deduplicate": "^6.0.1"
"@1stg/common-config": "^9.0.0",
"@octokit/request": "^8.1.4",
"@types/web": "^0.0.119",
"tsx": "^3.14.0",
"typescript": "^5.2.2",
"vercel": "^32.5.0",
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"prettier": "^2.8.7"
"prettier": "^2.8.8"
},
"commitlint": {
"extends": "@1stg"
Expand Down
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "@1stg/tsconfig/node16"
"extends": "@1stg/tsconfig/node16",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}
Loading

0 comments on commit 7ca5e03

Please sign in to comment.