In Meteor, How do I access a request object?

I am using Meteor 0.5.0 on windows. So far, I have not had many problems launching my application. My application will request requests from external sites, and they will send the information required by the request.

I looked at this: How do I access request parameters in Meteor? but it just booted onto a blank screen when I changed "foo" to the root. I still need a download page, as usual.

How can I access the request object in a meteor? I would like to look at server_variables as well as querystring.

Thanks in advance for any help you can offer ...

+4
source share
1 answer

The example in another post is good, but 1 more command is required and 2 teams need to be removed to make it work as you like.

SomeCollection = new Collection("...") fibers = __meteor_bootstrap__.require("fibers"); connect = __meteor_bootstrap__.require('connect') app = __meteor_bootstrap__.app router = connect.middleware.router (route) -> route.get '/', (req, res,next) -> Fiber () -> SomeCollection.insert(...) .run() next() app.use(router) 

This should solve your problem.

0
source

Source: https://habr.com/ru/post/1447004/


All Articles