fastboot-express-middleware icon indicating copy to clipboard operation
fastboot-express-middleware copied to clipboard

Unable to Pass Data to Fastboot through Middleware

Open vkoves opened this issue 8 years ago • 4 comments

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.

vkoves avatar Jan 06 '17 20:01 vkoves

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.

lukeclewlow avatar Aug 16 '17 13:08 lukeclewlow

@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 avatar Mar 22 '18 16:03 joshkg

@joshkg This was a while ago, I think we weren't able to do it and didn't do anything further with this.

vkoves avatar Mar 22 '18 22:03 vkoves

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.

viniciussbs avatar Jul 22 '20 19:07 viniciussbs