• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

strongloop / express
99%
master: 100%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Repo Added 31 Jul 2014 12:21AM UTC
Files 43
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH async-route-handlers
branch: async-route-handlers
CHANGE BRANCH
x
Reset
  • async-route-handlers
  • 3.15.3
  • 3.16.0
  • 3.16.1
  • 3.16.10
  • 3.16.2
  • 3.16.3
  • 3.16.4
  • 3.16.5
  • 3.16.6
  • 3.16.7
  • 3.16.8
  • 3.16.9
  • 3.17
  • 3.17.0
  • 3.17.1
  • 3.17.2
  • 3.17.3
  • 3.17.4
  • 3.17.5
  • 3.17.6
  • 3.17.7
  • 3.17.8
  • 3.18.0
  • 3.18.1
  • 3.18.2
  • 3.18.3
  • 3.18.4
  • 3.18.5
  • 3.18.6
  • 3.19.0
  • 3.19.1
  • 3.19.2
  • 3.20.0
  • 3.20.1
  • 3.20.2
  • 3.20.3
  • 3.21.0
  • 3.21.1
  • 3.21.2
  • 3.x
  • 4.10
  • 4.10.0
  • 4.10.1
  • 4.10.2
  • 4.10.3
  • 4.10.4
  • 4.10.5
  • 4.10.6
  • 4.10.7
  • 4.10.8
  • 4.11
  • 4.11.0
  • 4.11.1
  • 4.11.2
  • 4.12
  • 4.12.0
  • 4.12.1
  • 4.12.2
  • 4.12.3
  • 4.12.4
  • 4.13
  • 4.13.0
  • 4.13.1
  • 4.13.2
  • 4.13.3
  • 4.7.3
  • 4.7.4
  • 4.8.0
  • 4.8.1
  • 4.8.2
  • 4.8.3
  • 4.8.4
  • 4.8.5
  • 4.8.6
  • 4.8.7
  • 4.8.8
  • 4.9
  • 4.9.0
  • 4.9.1
  • 4.9.2
  • 4.9.3
  • 4.9.4
  • 4.9.5
  • 4.9.7
  • 4.9.8
  • 4.9.9
  • 4.x
  • 5.0
  • 5.0.0-alpha.1
  • 5.0.0-alpha.2
  • 5.x
  • add-security-process
  • appveyor
  • external-isAbsolute
  • fabien-fix/app-use-mw-mount
  • fce3d14
  • feature/customizable-router
  • fix-readme-link
  • for-freenode-irc
  • iterative-router
  • master
  • module-updates
  • node_08_4
  • readme-updates

pending completion
2528

push

travis-ci

defunctzombie
router: add async route handler support

While the async/await feature is still highly experimental and not
official, it does have preliminary support in tools like babel. There
are even blog posts [1] about how to use the async/await feature with
express routes.

However, these posts along with issue #2789 and #2788 show that using
async/await is still a bit of a manual process and not clear. This
change inspects the return value of a route handler to see if it is
potentially a pomise. If the return value appears to be a promise then
we attach to the error handler of the promise via .catch()

Now a user who is using babel can write the following without needing
any wrap functions as most examples to date require.

```js
app.get('/', async (req, res, next) => {
    let user = await User.findById(); // assuming .findById() returns a primise
    let org = await Org.findById();
    res.json({
        user: user,
        org: org,
    });
});
```

[1] https://strongloop.com/strongblog/async-error-handling-expressjs-es7-promises-generators/

6 of 6 new or added lines in 1 file covered. (100.0%)

1814 of 1824 relevant lines covered (99.45%)

2385.49 hits per line

Relevant lines Covered
Build:
Build:
1824 RELEVANT LINES 1814 COVERED LINES
2385.49 HITS PER LINE
Source Files on async-route-handlers
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
2528 async-route-handlers router: add async route handler support While the async/await feature is still highly experimental and not official, it does have preliminary support in tools like babel. There are even blog posts [1] about how to use the async/await feature with... push 18 Nov 2015 11:51PM UTC defunctzombie travis-ci pending completion  
See All Builds (1122)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc