wip
This commit is contained in:
parent
a3bd4ba426
commit
3368fe8552
20 changed files with 582 additions and 609 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import * as express from 'express';
|
||||
import * as Koa from 'koa';
|
||||
import summaly from 'summaly';
|
||||
|
||||
module.exports = async (req: express.Request, res: express.Response) => {
|
||||
const summary = await summaly(req.query.url);
|
||||
module.exports = async (ctx: Koa.Context) => {
|
||||
const summary = await summaly(ctx.query.url);
|
||||
summary.icon = wrap(summary.icon);
|
||||
summary.thumbnail = wrap(summary.thumbnail);
|
||||
res.send(summary);
|
||||
ctx.body = summary;
|
||||
};
|
||||
|
||||
function wrap(url: string): string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue