fix(web): fetch hello-world from local (#3062)

This commit is contained in:
Alex Yang
2023-07-06 17:46:17 +08:00
committed by GitHub
parent bda28e0404
commit e30c67482f
11 changed files with 36 additions and 8 deletions
@@ -0,0 +1,26 @@
import type { BlobStorage } from '@blocksuite/store';
export const createStaticStorage = (): BlobStorage => {
return {
crud: {
get: async (key: string) => {
if (key.startsWith('/static/')) {
const response = await fetch(key);
return response.blob();
}
return null;
},
set: async (key: string) => {
// ignore
return key;
},
delete: async () => {
// ignore
},
list: async () => {
// ignore
return [];
},
},
};
};