This project contains the slides for my talk about asynchronous programming with JS and the code samples.
If you want to play with the code, download this project and follow the build instructions.
You can change the port the server is listening
- Install MongoDB if you already don't have it.
- Install NodeJS if you already don't have it (at least 0.8, but I recommend latest stable version).
- Install Grunt 0.4
npm install -g grunt-cli
if you already don't have it. - Change to the
code/
directory and issuenpm install
command. - Change to the
code/lib/es
directory and issuenpm install
command in that directory. - Go back to
code/
and issuegrunt
command.
- Change to the
code/
directory - Unpack
db/sampledb.zip
. Asampledb/
directory should appear underdb/
- From
code/
start mongo withmongod --dbpath db/sampledb/
- From
code/
issuenode lib/server.js
to start the server - You can access the UI in the following URLs:
https://localhost:8081/frp .html
,https://localhost:8081/es .html
,https://localhost:8081/fp.html
andhttps://localhost:8081/rx.html
- Each URI is the same application but implemented with different approaches
- Try to search for
red
,shoe
,bag
,white
, etc.
- Change the file
config/settings.json
and restart the server - This file contains the configuration for the server:
{
"dbString":"mongodb:https://[user:password]@localhost:[port]/sample?w=1",
"port":[the port nodejs server is listening to],
"delay":[a delay in milliseconds to emulate network latency, must be > 1]
}