title: How to share global sidebar/footer on every route (webpage) in Koa/ Express?
body: <p>i have written a Website with Node.js and Koa/Express.</p>
  
  <p>i have this routes in my app.js:</p>
  
  <pre><code>router.use('/about/', about.routes()
  router.use('/blog/', blog.routes()
  router.use('/imprint/', imprint.routes())
  router.use('/', index.routes())
  router.use('/user/:id/', user.routes())
  app.use(router.routes())
  </code></pre>
  
  <p>and every page of this route has the same global sidebar with information about the latest blogs. Now i have a query for this (blogs on sidebar) on every route.</p>
  
  <pre><code>query database for blogs -&gt; save result to variable -&gt; render page with sidebar
  </code></pre>
  
  <p>Is it possible to to query this once on every request and set the result to a global variable and share this to the routes?</p>
  
  <p>Example:</p>
  
  <pre><code>1: User visit the website
  2: Koa query the results for the the sidebar (route: /)
  3. User see the sidebar on the webpage
  4: User click on a blog (new page route: /blog/)
  5: Koa share the result of the sidebar (Point 2)
  6: User see the sidebar on the webpage
  </code></pre>
  
  <p>...</p>