query string parameter value assign to local variable

7 views
Skip to first unread message

Paolo Vaca

unread,
Aug 16, 2015, 11:26:19 AM8/16/15
to Express
I need to assign the value of a query string parameter to an app.local variable.  this value could change for each page.

For instance:
?bundle=true

sets 
app.local.bundle = true
or
req.local.bundle = true

However, if i use middleware to use to set this value:
request.query.bundle

It will grab the query string on that first request, subsequent requests to the app, such as a JS file, will not include the query string and now the value gets overwritten or lost.

Is there a way to grab the query string value only for that first page/document request, and then ignore all other requests made to the application, until the next page load.

Or perhaps there is another way of accomplishing this

thanks

Reply all
Reply to author
Forward
0 new messages