Skip to content
Myr

async.js

This file

Path

examples/async.js

12 lines · 232 bytes · JavaScript

Last changed by

merged from upstreamcsausdevbefore adoptiona3acc21

History of this file

Take it

Asynchronous handlers working.csausdevbefore adoptionaa3167e

lines 1–3why, one step back
1require.paths.unshift("./lib")
2require('express')3

added logger to async examplecsausdevbefore adoptiona2f98e1

lines 4–5why, one step back
4use(Express.Logger)
5

merged from upstreamcsausdevbefore adoptiona3acc21

line 6why, one step back
6get('/wait/:ms', function() {

Asynchronous handlers working.csausdevbefore adoptionaa3167e

line 7why, one step back
7 setTimeout(function() {

merged from upstreamcsausdevbefore adoptiona3acc21

lines 8–9why, one step back
8 halt('Waited ' + param('ms') + ' milliseconds before replying')
9 }, param('ms'))

Asynchronous handlers working.csausdevbefore adoptionaa3167e

lines 10–11why, one step back
10});
11

merged from upstreamcsausdevbefore adoptiona3acc21

line 12why, one step back
12Express.start()