Finally I found following way how to solve that. I'm not sure if it's the best way, anyway it works :)
I needed to add server middleware server-middleware/postRequestHandler.js
const querystring = require('querystring');
module.exports = function (req, res, next) {
let body = '';
req.on('data', (data) => {
body += data;
});
req.on('end', () => {
req.body = querystring.parse(body) || {};
next();
});
};
nuxt.config.js
serverMiddleware: [
{ path: '/clickout', handler: '~/server-middleware/postRequestHandler.js' },
],
Clickout.vue
async asyncData(context) {
const id = context.req.body.id;
return { id }
}
I'm starting work on a members section of my website, using AngularJS. v0.1.0.php <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php ...
I'm starting work on a members section of my website, using AngularJS. v0.1.0.php <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php ...
I've been doing JS development for a long time now, and for years I thought I could short circuit a conditional statement using the logical AND. In fact, I do this ALL THE TIME in my React components ...
I've been doing JS development for a long time now, and for years I thought I could short circuit a conditional statement using the logical AND. In fact, I do this ALL THE TIME in my React components ...
I am trying to get value from two fields using the jQuery autocomplete with PHP, but I am not able to able to get the data. index.php: var availableTags = <?php include('autocomplete.php'); ?>;...
I am trying to get value from two fields using the jQuery autocomplete with PHP, but I am not able to able to get the data. index.php: var availableTags = <?php include('autocomplete.php'); ?>;...
The below code works, but I need to fire sela on change event by clicking on button, so console is written ipsum. Something like this: $('button').on('click', function(){ $('.sela').change('...
The below code works, but I need to fire sela on change event by clicking on button, so console is written ipsum. Something like this: $('button').on('click', function(){ $('.sela').change('...