Simple Node/Express app to demonstrate calling an asyncronous function (like a http get or db lookup) in an express middleware function and setting a returned value in the request object so that all routes will have access to it.
- Uses ES6 via Babel
- Uses Flow for type checking
- Uses Jest for tests (even snapshot tests a JSON return value)
- Uses Eslint
Let me know if you dig it :-)
This project was built with Node.js v9.3 and Yarn. If you have those installed, you should be able to run the following to get started:
git clone https://github.com/adamwysocki/asyncExpress.git
cd asyncExpress
yarn
Run yarn <script>
build
- run bable and build the final appcoverage
- run test coveragelint
- run linterstart
- run the servertest
- run the teststypecheck
- run flow