Closed oldCoder29 closed 6 years ago
I have a route which is: F.route('/1.1/charts/', handleCharts, ['delete','get','post','cors']); This route works fine with GET and POST but returns 404 response on delete.
F.route('/1.1/charts/', handleCharts, ['delete','get','post','cors']);
what i did is:
F.route('/1.1/charts/', handleCharts, ['get','post','cors']); F.route('/1.1/charts/', deleteChart, ['delete']);
Still the problem is same.
Now i did following and it worked:
F.route('/1.1/charts/', handleCharts, ['get','post','delete','cors']); F.route('/1.1/charts/', deleteChart, ['delete']);
This is how my controller looks like:
exports.install = function () { // F.route('/1.1/charts/', saveChart, ['post']); F.route('/1.1/charts/', handleCharts, ['delete','get','post','cors']); F.route('/1.1/charts/', deleteChart, ['delete']); }; async function handleCharts() { switch(this.req.method){ case "GET": return listCharts(this); break; case "POST": return saveChart(this); break; case "DELETE": return deleteChart(this); break; } } async function listCharts(controllerThis){ //do something } async function saveChart(controllerThis){ //do something } async function deleteChart(controllerThis){ //do something }
All the requests are from browser.(CORS required)
Hi, I'm solving it...
Hi, I have fixed it, please try to install latest beta version: $ npm install total.js@beta and give me a feedback.
$ npm install total.js@beta
Thank you for the report!
Now it works!!..
I have a route which is:
F.route('/1.1/charts/', handleCharts, ['delete','get','post','cors']);
This route works fine with GET and POST but returns 404 response on delete.what i did is:
Still the problem is same.
Now i did following and it worked:
This is how my controller looks like:
All the requests are from browser.(CORS required)