Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Router } from 'meteor/iron:router';
- Router.route('/testroute').post(function(){
- var response;
- if(this.request.body.userName === undefined || this.request.body.userPassword === undefined) {
- response = {
- "error" : true,
- "message" : "invalid data"
- };
- } else {
- console.log(" Request Body is : ",this.request.body);
- response = {
- "error" : false,
- "message" : "User added."
- }
- }
- this.response.setHeader('Content-Type','application/json');
- this.response.end(JSON.stringify(response));
- });
- Exception in callback of async function: TypeError: Cannot read property 'route' of undefined
Add Comment
Please, Sign In to add comment