Skip to content
Myr

async.js

This file

Path

examples/async.js

12 lines · 360 bytes · JavaScript

Last changed by

added logger to async examplecsausdevbefore adoption5734bd5

History of this file

Take it

Asynchronous handlers working.csausdevbefore adoptiona3ca40e

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

added logger to async examplecsausdevbefore adoption5734bd5

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

Asynchronous handlers working.csausdevbefore adoptiona3ca40e

lines 6–12why, one step back
6get('hello/:value/:time', function() {
7 setTimeout(function() {8 Express.server.finished('<html><head><title>Asynchronous Example</title></head><body><h1>Hello '+param('value')+', I waited '+param('time')+'ms to talk to you.</h1></body></html>')9 }, param('time'))10});1112Express.start();