totaljs / framework4

Total.js framework v4
https://www.totaljs.com
Other
97 stars 36 forks source link

convert 404 page into json is only working for get method only #11

Closed aalfiann closed 3 years ago

aalfiann commented 3 years ago

Hello,

I've tried to convert the 404 page into json like this

ROUTE('#404', function() {
    this.status = 404;
    this.json({ error: 'Unauthorized' });
}, ['get','post']);

That only work for GET method only.

So my question is how to make it work for POST too?

petersirka commented 3 years ago

Yes, there was a bug - sorry for troubles. I have fixed it and I'll publish a new version of Total.js 4 today later. Now you can test the fix in beta version: $ npm install total4@beta.

Thank you!