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

(cherry picked from commit e30c67482f)
This commit is contained in:
Alex Yang
2023-07-06 17:46:17 +08:00
parent d2503d46eb
commit 031dd6d4ea
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 [];
},
},
};
};