app: more precise template typeRegrx
This commit is contained in:
parent
a25a9b2f68
commit
b12e45fa2a
|
|
@ -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) || ['', ''];
|
||||
|
|
|
|||
Loading…
Reference in New Issue