Comments
This commit is contained in:
@@ -89,7 +89,10 @@ export default function (ctx: AppContext, app: Express) {
|
|||||||
|
|
||||||
return res.end(output.asPng())
|
return res.end(output.asPng())
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
httpLogger.warn({err, uri: uri.toString()}, 'could not fetch post')
|
httpLogger.warn(
|
||||||
|
{err, uri: uri.toString()},
|
||||||
|
`Failed to render post ${uri}`,
|
||||||
|
)
|
||||||
return res.status(404).end('not found')
|
return res.status(404).end('not found')
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import {getWidthWithMat} from './frameMatting.js'
|
|||||||
|
|
||||||
export const DEFAULT_WIDTH = 360
|
export const DEFAULT_WIDTH = 360
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options parsed from the query string, passed to the components themselves.
|
||||||
|
*/
|
||||||
export type DisplayOptions = {
|
export type DisplayOptions = {
|
||||||
mat: boolean
|
mat: boolean
|
||||||
}
|
}
|
||||||
@@ -25,6 +28,10 @@ export function parseDisplayOptionsFromQuery(query: ParsedQs): DisplayOptions {
|
|||||||
return opts
|
return opts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options computed from the parsed query options, passed to the render
|
||||||
|
* function.
|
||||||
|
*/
|
||||||
export function getRenderOptions(options: DisplayOptions) {
|
export function getRenderOptions(options: DisplayOptions) {
|
||||||
return {
|
return {
|
||||||
// must match width + padding of Post.tsx
|
// must match width + padding of Post.tsx
|
||||||
|
|||||||
Reference in New Issue
Block a user