, so the railroad felt that it could be very profitable. The average number of workers on the Alpine Tunnel was between 350 and 400 working thru nasty winters and summers until July 1881 when the 2 crews met each other in the tunnel. The length of the Alpine Tunnel is 1771.7 feet long within the mountain. The headings were off by only 11/100ths of a foot. This is pretty accurate considering that it was a blind bore, on a curve laid to opposing grades.
Restored Telegraph Station To really appreciate how accurate of a job the tunnel crews were able to accomplish, you'll need to see the engineering drawing that is located within the restored Alpine Tunnel Telegraph Station.
This whole area is being restored by a 4 Wheel Drive club and they come up every year to rebuild more of the out buildings and try to recreate the feel of the what the this looked like at the turn of the century - there is a collection box at the Telegraph Station.
The actual entrance to the tunnel is around 1/8 of a mile further down the path (which used to be track). The entrance to the Tunnel was sealed by a cave in many years ago, but, there is an effort to restore the entrance and a few hundred feet in, and cover this with a gate (we don't want to have the tunnel collapse on anyone).
On either side of the track, you'll see what looks like a fine meadow - its really a swamp marsh/bog. Many high altitude areas have these swamp marsh/bogs and they look very inviting; driving thru them will probably cause your vehicle to sink up to the door handles - please stay on established roads (Note: There are no marshes/bogs anywhere along this drive).
Stone Plaque - near the tunnel entrance The road that leads here is built up against a wall of granite, and there is little vegetation to hold anything in place. It was common to have 20 or more feet of snow accumulate here in the winter; making this a very expensive train line to keep open year-round. The Alpine Tunnel was officially closed in 1910 because of this - it simply was too costly to operate. Usually, the last 3 miles of this trip takes a while to melt off the snow and ice, and you can't get here until the middle of July or later.
I was happy to see this facility near the Western Alpine Tunnel workings. Since I usually eat about an hour before getting here, it is very well placed. During the summer months there is usually a Forest Service person here to answer any questions that you may have. There are also a number of books on the Alpine Tunnel that you may want to review before visiting.
If you have questions about the Alpine Tunnel site restoration, Ray Rossman is the U.S. Forest Service Archaeologist that is working at the site. He would be happy to answer your questions if he can. There are a number of things that you might be able to help out with at the site; let him know!
There is also another Website that discusses the Alpine Tunnel along with other historic narrow gauge train routes. See The Alpine Tunnel Historical District. You can even sign up for a membership in the Alpine Tunnel Historical Association here (My freind Scott Guthrie joined last year - he appears in the picture near the water tower on this web page).<filename>test/hemera/middleware.spec.js<gh_stars>0
'use strict'

describe('Middleware', function() {
  var PORT = 6242
  var authUrl = 'nats://localhost:' + PORT
  var server

  // Start up our own nats-server
  before(function(done) {
    server = HemeraTestsuite.start_server(PORT, done)
  })

  // Shutdown our server after we are done
  after(function() {
    server.kill()
  })

  it('Should be able to define server method with chaining syntax', function(done) {
    const nats = require('nats').connect(authUrl)

    const hemera = new Hemera(nats)

    hemera.ready(() => {
      hemera
       .add({
          topic:'math',
          cmd: 'add'
        })
       .use(function(req, resp, next) {
          next()
        })
       .end(function(req, cb) {
          cb(null, req.a + req.b)
        })

      hemera.act(
        {
          topic:'math',
          cmd: 'add',
          a: 1,
          b: 2
        },
        function(err, resp) {
          expect(err).to.be.not.exists()
          expect(resp).to.be.equals(3)
          hemera.close(done)
        }
      )
    })
  })

  it('Should be able to return promise', function(done) {
    const nats = require('nats').connect(authUrl)

    const hemera = new Hemera(nats, { logLevel: 'info' })

    hemera.ready(() => {
      hemera
       .add({
          topic:'math',
          cmd: 'add'
        })
       .use(function(req, resp) {
          return Promise.resolve('test')
        })
       .end(req => Promise.resolve(req.a + req.b))

      hemera.act(
        {
          topic:'math',
          cmd: 'add',
          a: 1,
          b: 2
        },
        function(err, resp) {
          expect(err).to.be.not.exists()
          expect(resp).to.be.equals(3)
          hemera.close(done)
        }
      )
    })
  })

  it('Should be able to define middleware for a server method with chaining syntax', function(done) {
    const nats = require('nats').connect(authUrl)

    const hemera = new Hemera(nats)
    let callback = Sinon.spy()

    hemera.ready(() => {
      hemera
       .add({
          topic:'math',
          cmd: 'add'
        })
       .use(function(req, resp, next) {
          callback()
          next()
        })
       .use(function(req, resp, next) {
          callback()
          next()
        })
       .end(function(req, cb) {
          cb(null, req.a + req.b)
        })

      hemera.act(
        {
          topic:'math',
          cmd: 'add',
          a: 1,
          b: 2
        },
        function(err, resp) {
          expect(err).to.be.not.exists()
          expect(resp).to.be.equals(3)
          expect(callback.calledTwice).to.be.equals(true)
          hemera.close(done)
        }
      )
    })
  })

  it('Should be able to pass an array of middleware function for a server method', function(done) {
    const nats = require('nats').connect(authUrl)

    const hemera = new Hemera(nats)
    let callback = Sinon.spy()

    hemera.ready(() => {
      hemera
       .add({
          topic:'math',
          cmd: 'add'
        })
       .use([
          function(req, resp, next) {
            callback()
            next()
          },
          function(req, resp, next) {
            callback()
            next()
          }
        ])
       .end(function(req, cb) {
          cb(null, req.a + req.b)
        })

      hemera.act(
        {
          topic:'math',
          cmd: 'add',
          a: 1,
          b: 2
        },
        function(err, resp) {
          expect(err).to.be.not.exists()
          expect(resp).to.be.equals(3)
          expect(callback.calledTwice).to.be.equals(true)
          hemera.close(done)
        }
      )
    })
  })

  it('Should be able to reply in middleware', function(done) {
    const nats = require('nats').connect(authUrl)

    const hemera = new Hemera(nats)

    hemera.ready(() => {
      hemera
       .add({
          topic:'math',
          cmd: 'add'
        })
       .use(function(req, resp, next) {
          resp.send({ a: 1 })
          next()
        })
       .end(function(req, cb) {
          cb(null, req.a + req.b)
        })

      hemera.act(
        {
          topic:'math',
          cmd: 'add',