File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
apps/svelte.dev/src/routes/devtools/updates.json Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change
1
+ import { error , json } from '@sveltejs/kit' ;
2
+ import type { ServerlessConfig } from '@sveltejs/adapter-vercel' ;
3
+
4
+ export const config : ServerlessConfig = {
5
+ isr : {
6
+ expiration : 300
7
+ }
8
+ } ;
9
+
1
10
// We manage FF extension by ourselves through GH releases and this acts as `update_url`
2
11
// for our users to automatically update their extension when a new version is released
3
12
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#update_url
13
+ export async function GET ( { fetch } ) {
14
+ const response = await fetch ( 'https://api.github.com/repos/sveltejs/svelte-devtools/tags' ) ;
4
15
5
- import { json } from '@sveltejs/kit' ;
6
-
7
- export const prerender = true ;
16
+ if ( ! response . ok ) {
17
+ error ( response . status ) ;
18
+ }
8
19
9
- export async function GET ( { fetch } ) {
10
- const gh : Array < { name : string } > = await fetch (
11
- 'https://api.github.com/repos/sveltejs/svelte-devtools/tags'
12
- ) . then ( ( r ) => r . json ( ) ) ;
20
+ const gh : Array < { name : string } > = await response . json ( ) ;
13
21
14
22
// v2.2.0 is the first version that has the Firefox extension
15
23
const tags = gh . reverse ( ) . slice ( gh . findIndex ( ( t ) => t . name === 'v2.2.0' ) ) ;
You can’t perform that action at this time.
0 commit comments