I'm trying to get the end part of this URL (in the sever side):
http://localhost:3000/insAds/D79htZY8DQ3YmcscE
I mean I want to get this string:
D79htZY8DQ3YmcscE
there is a similar question: How to get the query parameters in Iron-router?
but non of the answers can't help me! because I have no query params in the URL.
I know these codes gives me the string that I want:
this.params.id
and
Router.current().params.id
but these codes works only in client side! I want to get that string in the server side!
finally I'm trying to get that string and use here:
Ads.before.insert(function(userId, doc) {
//console.log(this.params.id);
doc._categoryId = this.params.id;
doc.createdAt = new Date();
doc.createdBy = Meteor.userId();
});