Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

1.1.0

Compare
Choose a tag to compare
@tmarshall tmarshall released this 01 Aug 20:45
· 66 commits to master since this release
e44d80f

Features

Direct function exports

When using crawSync you can now export functions directly.

module.exports = (req, res) => res.send('works')

Or an array of handlers

const handlers = []
handlers.push((req, res, next) => {
  req.asdf = 123
  next()
})
handlers.push((req, res) => {
  res.send(req.asdf) // '123'
})
module.exports = handlers

Resolved configuration jsons

Another feature added to syncCrawl is support for saving route configs in .json files, which are resolved as files as crawled.

.
└── routes
    ├─── routes.json             # { a: 123 }
    ├─── account                 # resolves { a: 123 }
    │   ├── routes.json          # { b: 456 }
    │   ├── get.js               # resolves { a: 123, b: 456 }
    └── get.js                   # resolves { a: 123 }

Inline config (direct in a Route constructor) overrides any resolved values.

Patches

  • bumped dependencies
  • some general housekeeping
  • restricting node engine to 12.x.x
  • added an examples directory