Learn Express.js from the author of one of the best books on Express.js—Pro Express.js—workshop to teach you basics of Express.js.
ExpressWorks will provide you with tasks and hints. You write the solutions to these problems. Then, after you wrote a solution as an Express.js app, ExpressWorks will verify your solution to the problem.
Video screencasts which walk your through setup and problems (spoiler alert): YouTube ExpressWorks. 📺💻😁
105 Azat Mardan55 Azat Mardanov19 Christophe Porteneuve10 Tyler Moeller10 azat-co9 RamiroPinol8 Justin Porter8 Elias Meire6 billy33214 Kohei TAKATA3 Charlotte Spencer3 Harry Moreno2 Austin Corso2 Julian Mazzitelli2 Kevin Jayanthan2 Robbie Holmes2 Shim Won2 Thomas Burette2 intrueder1 Alessandro Lensi1 Alfredo Miranda1 Ayman Mahfouz1 Daniel Geier1 Dylan Smith1 Eddie Hsieh1 Finn1 Gabe Fernando1 Giuseppe1 Jessie Shi1 Johan Binard1 Jonny Arnold1 Kevin Kuhl1 Louis Pilfold1 Rich Trott1 Richard Kho1 Ryan Kois1 Timothy Gu1 Trevor Whitney1 Wojciech Gawronski1 brownman1 raj1 swisherb1 tdtsh1 Victor Hugo Rocha
Make a PR to see your name here. ;-)
$ git shortlog -n -s. Please add yourself to the list when making a pull request.
Recommended global installation:
$ npm install -g expressworks$ expressworks
If you see errors, try:
$ sudo npm install -g expressworks$ expressworks
Run & install locally:
$ mkdir node_modules$ npm install expressworks$ cd node_modules/expressworks$ node expressworks
Optional step that gives you the global command (
expressworks) in the Terminal/command prompt:
$ npm link$ expressworks
Note: ExpressWorks depends on a local copy of Express being available in your project folder. To do the exercises, make sure to install the Express.js with
$ npm init$ npm install firstname.lastname@example.org
See Offline Setup for more required dependencies.
ExpressWorks understands these commands:
UsageexpressworksShow a menu to interactively select a workshop.expressworks listShow a newline-separated list of all the workshops.expressworks select NAMESelect a workshop.expressworks currentShow the currently selected workshop.expressworks run program.jsRun your program against the selected input.expressworks verify program.jsVerify your program against the expected output.
If you would like to setup all node packages beforehand, you can complete this workshop offline. Here are all the modules to install with exact versions that this workshop supports:
$ npm install email@example.com$ npm install firstname.lastname@example.org$ npm install email@example.com$ npm install firstname.lastname@example.org
Note: You need to have
packagen.json in your project folder before installing dependencies. Run
$ mkdir node_modules or
$ npm init to create one of them.
If you want to reset the list of completed tasks, clean the
Create an Express.js app that runs on localhost:3000, and outputs "Hello World!" when somebody goes to root '/home'.
process.argv will be provided by expressworks to you, this is the port number.
Create an Express.js app with a home page (/home) rendered by pug template engine, that shows current date (toDateString).
Write a route ('/form') that processes HTML form input () and prints backwards the str value.
Apply static middleware to server index.html file without any routes. The index.html file is provided and usable via
process.argv value of the path to it. However, you can use your own file with this content:
I am red!
Style your HTML from previous example with some Stylus middleware. The path to main.styl file is provided in
process.argv or you can create your own file/folder from these:
The index.html file:
expressworksI am red!
Create an Express.js server that processes PUT
/message/:id requests, e.g., PUT
As the response of this request return id SHA1 hashed with a date:
Write a route that extracts data from query string in the GET
/search URL route, e.g.,
?results=recent&include_tabs=true, and then transforms outputs it back to the user in JSON format.
Write a server that reads a file (file name is passed in
process.argv), parses it to JSON and outputs the content to the user with