我可以让我的 cdn 使用令牌直接联系 firebase 存储然后 return 文件而不是令牌吗?
Can i make my cdn directly contact firebase storage with the token then return the file only not the token?
所以我需要 cdn.ex.com/avatars/:UserID
指向我的云私有文件 URI,它是 https://cloudapi.com/account.cloud.com/files/uploads/avatars/(userid)/avatar.png?token=${genNewTok()}
(放置了 true URL)
除了
,我还没有任何代码
app.get('/avatars/:userid', (req, res)=>{
let userid = req.params.userid
let uri = `https://cloudapi.com/account.cloud.com/files/uploads/avatars/${userid}/avatar.png?token=${genNewTok()}`
});
所以我可以在html:
<span>Username</span>
<img class="pfp" src="cdn.ex.com/avatars/671856275627525">
不必做
<span>Username</span>
<img class="pfp" src="https://cloudapi.com/account.cloud.com/files/uploads/avatars/671856275627525/avatar.png">
关于我该怎么做的任何帮助?
我找到了答案。
您需要访问 metadata.metadata.firebasetokenthingy
并将其添加到 uri。
所以我需要 cdn.ex.com/avatars/:UserID
指向我的云私有文件 URI,它是 https://cloudapi.com/account.cloud.com/files/uploads/avatars/(userid)/avatar.png?token=${genNewTok()}
(放置了 true URL)
除了
app.get('/avatars/:userid', (req, res)=>{
let userid = req.params.userid
let uri = `https://cloudapi.com/account.cloud.com/files/uploads/avatars/${userid}/avatar.png?token=${genNewTok()}`
});
所以我可以在html:
<span>Username</span>
<img class="pfp" src="cdn.ex.com/avatars/671856275627525">
不必做
<span>Username</span>
<img class="pfp" src="https://cloudapi.com/account.cloud.com/files/uploads/avatars/671856275627525/avatar.png">
关于我该怎么做的任何帮助?
我找到了答案。 您需要访问 metadata.metadata.firebasetokenthingy 并将其添加到 uri。