app: more precise template typeRegrx

This commit is contained in:
DIYgod 2018-05-24 16:22:14 +08:00
parent a25a9b2f68
commit b12e45fa2a
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
const art = require('art-template');
const path = require('path');
const config = require('../config');
const typeRegrx = /\.([a-z]+)$/;
const typeRegrx = /\.(atom|rss|json)$/;
module.exports = async (ctx, next) => {
ctx.state.type = ctx.request.path.match(typeRegrx) || ['', ''];