go.componentowl.com redirect Worker
This commit is contained in:
14
src/index.js
Normal file
14
src/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const REDIRECTS = {
|
||||
'blv-tech-comparison': 'http://www.componentowl.com/quick-start-guide/better-listview/data/chapter-appendix-matrix.html',
|
||||
};
|
||||
const HOME = 'https://www.componentowl.com';
|
||||
|
||||
export default {
|
||||
async fetch(request) {
|
||||
const url = new URL(request.url);
|
||||
const path = url.pathname.replace(/^\//, '').replace(/\/$/, '');
|
||||
const dest = REDIRECTS[path] || HOME;
|
||||
const qs = url.search || '';
|
||||
return Response.redirect(dest + qs, 302);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user