I can not believe that there is no simple answer. I want to redirect, say:
www.example.com/this-url-does-not-exist
to
www.example.com/
There has to be a way, all the hub sites with koajs just can't crash? Heres my router (I use koa with koa-router):
router .get('/', function* (next) { this.body = "public: /"; }) .get('/about', function* (next) { this.body = "public: /about"; }) .get('*', function* (next) {
And donβt tell me to use regular expressions, I tried with them too, and this means that you manually update the expression when adding URLs, etc., which is not what I am looking for, plus it does not work since javascript does not support negative images.
source share