Skip to content
Snippets Groups Projects
Commit a4e142be authored by good-karma's avatar good-karma
Browse files

Define default size

parent 1a1bc8db
No related branches found
No related tags found
1 merge request!12Define default size for cover
...@@ -8,6 +8,8 @@ import {KoaContext, rpcClient} from './common' ...@@ -8,6 +8,8 @@ import {KoaContext, rpcClient} from './common'
import {APIError} from './error' import {APIError} from './error'
const DefaultCover = config.get('default_cover') as string const DefaultCover = config.get('default_cover') as string
const sizeW = 1344
const sizeH = 240
export async function coverHandler(ctx: KoaContext) { export async function coverHandler(ctx: KoaContext) {
ctx.tag({handler: 'cover'}) ctx.tag({handler: 'cover'})
...@@ -58,5 +60,5 @@ export async function coverHandler(ctx: KoaContext) { ...@@ -58,5 +60,5 @@ export async function coverHandler(ctx: KoaContext) {
} }
ctx.set('Cache-Control', 'public,max-age=600') ctx.set('Cache-Control', 'public,max-age=600')
ctx.redirect(`/p/${ base58Enc(coverUrl) }?width=${ size }&height=${ size }`) ctx.redirect(`/p/${ base58Enc(coverUrl) }?width=${ sizeW }&height=${ sizeH }`)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment