整理した
This commit is contained in:
parent
8a279a4656
commit
cf33e483f7
552 changed files with 360 additions and 1311 deletions
|
|
@ -1,15 +0,0 @@
|
|||
import * as express from 'express';
|
||||
import summaly from 'summaly';
|
||||
|
||||
module.exports = async (req: express.Request, res: express.Response) => {
|
||||
const summary = await summaly(req.query.url);
|
||||
summary.icon = wrap(summary.icon);
|
||||
summary.thumbnail = wrap(summary.thumbnail);
|
||||
res.send(summary);
|
||||
};
|
||||
|
||||
function wrap(url: string): string {
|
||||
return url != null
|
||||
? `https://images.weserv.nl/?url=${url.replace(/^https?:\/\//, '')}`
|
||||
: null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue