feat: use asar for twemoji assets

This commit is contained in:
NGPixel
2020-05-24 18:02:05 -04:00
parent a8578c5012
commit 8205faca53
5 changed files with 153 additions and 0 deletions

View File

@@ -53,6 +53,13 @@ module.exports = async () => {
// ----------------------------------------
app.use(favicon(path.join(WIKI.ROOTPATH, 'assets', 'favicon.ico')))
app.use('/_assets/svg/twemoji', async (req, res, next) => {
try {
WIKI.asar.serve('twemoji', req, res, next)
} catch (err) {
res.sendStatus(404)
}
})
app.use('/_assets', express.static(path.join(WIKI.ROOTPATH, 'assets'), {
index: false,
maxAge: '7d'