+ redirect table support

This commit is contained in:
tmshv committed 2016-02-27 19:42:44 +03:00
1 parent 80719055b3
commit 26c0534372
4 files changed
+41 -1

No files matched your search

+13 -1
View File
@@ -37,4 +37,16 @@ export default Object.keys(privateData)
.reduce((config, key) => {
config[key] = privateData[key];
return config;
}, config);
}, config);
let redirectPath = path.join(__dirname, '../redirect.tsv');
export const redirectionTable = fs.readFileSync(redirectPath, 'utf-8')
.split('\n')
.map(row => row.split(/\s+/))
.map(row => {
let [from, to] = row;
return {
'url': from,
'redirect': to
}
});