Kuzmin / node-cache-middleware

Basic caching middleware for Express/Connect-based apps
2 stars 1 forks source link

Add as browsersync/connect middleware #1

Open vviikk opened 7 years ago

vviikk commented 7 years ago

Hey there.

I'm trying to get this to work as a middleware in connect (what BrowserSync uses). Here's the link to their docs https://browsersync.io/docs/options#option-middleware

I'm currently loading it like so: image

Don't this it's working though. I have to add my own req.header function because the method didn't exist in the req object.

Kuzmin commented 7 years ago

@piggyslasher: I have only used this with Express unfortunately. Is adding the header method a viable option to make this work for you? I'm currently sloshed with work so I will not be able to look into Connect middleware compatibility for some time, but if you want to submit a PR it's more than welcome!