Skip to content

Commit

Permalink
docs: Add the usage of urlInterrupter for app-slide
Browse files Browse the repository at this point in the history
  • Loading branch information
haoran965 committed Nov 15, 2024
1 parent 74afbea commit 8c8bab4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/app-slide/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ WindowManager.register({
appOptions: {
// 打开这个选项显示 debug 工具栏
debug: false,
urlInterrupter: async (url: string) => {
// 一般会有不同的实现,比如签名。
const { ak, expire } = await getSTSToken(); // 客户的客户端实现。
return `${url}?expire=${expire}&ak=${ak}`;
},
// 更多选项可以在 https://github.com/netless-io/netless-slide-demo#slide-%E9%85%8D%E7%BD%AE 查看
},
src: async () => {
const app = await import("@netless/app-slide");
Expand Down
7 changes: 7 additions & 0 deletions packages/app-slide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ WindowManager.register({
appOptions: {
// turn on to show debug controller
debug: false,
urlInterrupter: async (url: string) => {
// There will be different implementations depending on different cloud storage services.
// Generally, signatures are added to the query parameters.
const { ak, expire } = await getSTSToken(); // Customer service side implementation.
return `${url}?expire=${expire}&ak=${ak}`;
// https://github.com/netless-io/netless-slide-demo#slide-%E9%85%8D%E7%BD%AE for more options
},
},
src: async () => {
const app = await import("@netless/app-slide");
Expand Down

0 comments on commit 8c8bab4

Please sign in to comment.