Handle not found shorten URL

This commit is contained in:
Damillora 2019-09-28 16:45:11 +07:00
parent e44480ff21
commit ff7ba342bc

View File

@ -3,6 +3,9 @@ import { tall } from 'tall';
export default function (context) {
return tall(process.env.SHORTENER_BASE+context.route.path).then(function(unshortenedUrl) {
if(unshortenedUrl == process.env.SHORTENER_BASE) {
return;
}
context.redirect(unshortenedUrl);
});
// context.redirect("https://nanao.moe");