[www] + Config model; config updated; using remote config; server refactoring

This commit is contained in:
Roman Timashev committed 2017-09-19 13:45:06 +03:00
1 parent 18a0b36a09
commit 5ad321ec0e
7 files changed
+85 -69

No files matched your search

-19
View File
@@ -1,19 +0,0 @@
/**
*
* @param redirectionTable
* [{String url, String redirect}, ...]
* @returns {*}
*/
export function redirect(redirectionTable) {
return function *(next) {
let path = this.request.path;
let record = redirectionTable.find(i => i.url === path);
if(record){
this.redirect(record.redirect);
return;
}
yield next;
};
}