1
1
import { Buffer } from 'node:buffer'
2
2
import { env } from 'node:process'
3
3
4
-
5
4
import { Blobs } from '@netlify/blobs'
6
5
import { Handler , HandlerContext } from '@netlify/functions'
7
6
@@ -15,13 +14,13 @@ export const setBlobFiles = async ({ NETLIFY_API_HOST, NETLIFY_API_TOKEN, SITE_I
15
14
siteID : SITE_ID ,
16
15
} )
17
16
18
- const files = filePaths . map ( ( filePath ) => ( { key : filePath , path : filePath } ) )
17
+ const files = filePaths . map ( ( filePath ) => ( { key : filePath , path : filePath } ) )
19
18
20
- // setFile reads the file path and stores the content within the blob,
21
- // we set the key with the same file path so we can retrieve the file contents later using the path
22
- await blobs . setFiles ( files )
19
+ // setFile reads the file path and stores the content within the blob,
20
+ // we set the key with the same file path so we can retrieve the file contents later using the path
21
+ await blobs . setFiles ( files )
23
22
24
- console . log ( " SSR Files are now in the blob" , { blobs } )
23
+ console . log ( ' SSR Files are now in the blob' , { blobs } )
25
24
}
26
25
27
26
export const getBlobFile : Handler = async ( { headers, path } , context : HandlerContext ) => {
@@ -35,7 +34,7 @@ export const getBlobFile: Handler = async ({ headers, path }, context: HandlerCo
35
34
} ,
36
35
context : `deploy:${ headers [ 'x-nf-deploy-id' ] } ` ,
37
36
siteID : headers [ 'x-nf-site-id' ] ,
38
- } )
37
+ } )
39
38
40
39
const value = await blobs . get ( path )
41
40
0 commit comments