fastboot-express-middleware
fastboot-express-middleware copied to clipboard
Unable to Pass Data to Fastboot through Middleware
I was working on a feature that used an npm package to get the IP address of a client conncting to the Fastboot server, which was configured as a middleware in fastboot-server.js, which initializes Fastboot using this middleware. However, it appears that there is no way to pass data to Fastboot through fastboot-express-middleware, which makes it very challenging to extend Fastboot using other middlewares.
Let me know if you need more information about my use case, but overall I think it would be important to maintain modularity by allowing information to be passed into Fastboot through this middleware.
Can't you pass through on the request object? If you add something to the request, you also have access to that within your fastboot ember application. Not sure if i'm getting the wrong end of the stick about the use case though.
@vkoves Were you able to figure this one out? I'm in a position where I need to pass the IP address of the client into fastboot as well!
@joshkg This was a while ago, I think we weren't able to do it and didn't do anything further with this.
It looks like the this.fastboot.request is an object with some informations extracted from Express' request. It's not Express' request object itself.
In my case, I would like to know if the request was made from a mobile browser. I already have req.useragent.isMobile working on my server, but I can't access this information running this.fastboot.request.useragent.isMobile.