サムネイルを予め生成するように
This commit is contained in:
@@ -6,7 +6,6 @@ import * as fs from 'fs';
|
||||
import * as Koa from 'koa';
|
||||
import * as cors from '@koa/cors';
|
||||
import * as Router from 'koa-router';
|
||||
import pour from './pour';
|
||||
import sendDriveFile from './send-drive-file';
|
||||
|
||||
// Init app
|
||||
@@ -24,12 +23,14 @@ const router = new Router();
|
||||
|
||||
router.get('/default-avatar.jpg', ctx => {
|
||||
const file = fs.createReadStream(`${__dirname}/assets/avatar.jpg`);
|
||||
pour(file, 'image/jpeg', ctx);
|
||||
ctx.set('Content-Type', 'image/jpeg');
|
||||
ctx.body = file;
|
||||
});
|
||||
|
||||
router.get('/app-default.jpg', ctx => {
|
||||
const file = fs.createReadStream(`${__dirname}/assets/dummy.png`);
|
||||
pour(file, 'image/png', ctx);
|
||||
ctx.set('Content-Type', 'image/jpeg');
|
||||
ctx.body = file;
|
||||
});
|
||||
|
||||
router.get('/:id', sendDriveFile);
|
||||
|
Reference in New Issue
Block a user