• Stars
    star
    684
  • Rank 66,068 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learn Express.js from the author of one of the best books on Express.js—Pro Express.js— with this workshop that will teach you basics of Express.js.

expressworks

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.

Hello World Express.js app

This workshop is based on workshopper and inspired by stream-adventure by @substack and @maxogden.

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 you through setup and problems (spoiler alert): YouTube ExpressWorks. 📺💻😁

This workshop is brought to you by the author of Pro Express.js (Apress 2014) Azat Mardan.

Cheatsheet

You might want to download the free Express.js cheatsheet before embarking on a journey, or view it online.

Languages

  • English
  • Spanish
  • French
  • Simplified Chinese
  • Traditional Chinese
  • Korean
  • Japanese

Contributors

117  Azat Mardan
55  Azat Mardanov
19  Christophe Porteneuve
10  Tyler Moeller
10  azat-co
 9  RamiroPinol
 8  Elias Meire
 8  Justin Porter
 6  billy3321
 4  Kohei TAKATA
 4  Shim Won
 3  Charlotte Spencer
 3  Harry Moreno
 3  Kaelig Deloumeau-Prigent
 2  Austin Corso
 2  Julian Mazzitelli
 2  Kevin Jayanthan
 2  Robbie Holmes
 2  Thomas Burette
 2  Victor Hugo
 2  intrueder
 1  Alessandro Lensi
 1  Alfredo Miranda
 1  Apricity
 1  Ayman Mahfouz
 1  Chuanfeng
 1  Daniel Geier
 1  Dylan Smith
 1  Eddie Hsieh
 1  Finn
 1  Gabe Fernando
 1  Giuseppe
 1  Hanbyul Jin
 1  Jessie Shi
 1  Johan Binard
 1  Jonny Arnold
 1  Kevin Kuhl
 1  Louis Pilfold
 1  Luis Del Águila
 1  Naitian Zhou
 1  Rich Trott
 1  Richard Kho
 1  Ryan Kois
 1  Timothy Gu
 1  Trevor Whitney
 1  Wojciech Gawronski
 1  brownman
 1  raj
 1  swisherb
 1  tdtsh

Make a PR to see your name here. ;-)

PS: via $ git shortlog -n -s. Please add yourself to the list when making a pull request.

Installation (Recommended)

Recommended global installation:

$ npm install -g expressworks
$ expressworks

If you see errors, try:

$ sudo npm install -g expressworks
$ expressworks

Local Installation (Advanced)

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

Usage

$ 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 [email protected]

See Offline Setup for more required dependencies.

ExpressWorks understands these commands:

Usage

  expressworks
    Show a menu to interactively select a workshop.
  expressworks list
    Show a newline-separated list of all the workshops.
  expressworks select NAME
    Select a workshop.
  expressworks current
    Show the currently selected workshop.
  expressworks run program.js
    Run your program against the selected input.
  expressworks verify program.js
    Verify your program against the expected output.

Offline Setup

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 protected]
$ npm install [email protected]
$ npm install [email protected]
$ npm install [email protected]

Note: You need to have node_modules or packagen.json in your project folder before installing dependencies. Run $ mkdir node_modules or $ npm init to create one of them.

Reset

If you want to reset the list of completed tasks, clean the ~/.config/expressworks/completed.json file.

Hello World Express.js app

More Information

Check out Express.js Guide, Pro Express.js and FREE Express.js cheatsheet.

Steps

Hello World

Create an Express.js app that runs on localhost:3000, and outputs "Hello World!" when somebody goes to root '/home'.

process.argv[2] will be provided by expressworks to you, this is the port number.

Pug

Create an Express.js app with a home page (/home) rendered by pug template engine, that shows current date (toDateString).

Good Old Form

Write a route ('/form') that processes HTML form input (<form><input name="str"/></form>) and prints backwards the str value.

Static

Apply static middleware to server index.html file without any routes. The index.html file is provided and usable via process.argv[3] value of the path to it. However, you can use your own file with this content:

  <html>
    <head>
      <link rel="stylesheet" type="text/css" href="/main.css"/>
    </head>
    <body>
      <p>I am red!</p>
    </body>
  </html>

Stylish CSS

Style your HTML from previous example with some Stylus middleware. The path to main.styl file is provided in process.argv[3] or you can create your own file/folder from these:

  p
    color red

The index.html file:

  <html>
    <head>
      <title>expressworks</title>
      <link rel="stylesheet" type="text/css" href="/main.css"/>
    </head>
    <body>
      <p>I am red!</p>
    </body>
  </html>

Param Pam Pam

Create an Express.js server that processes PUT /message/:id requests, e.g., PUT /message/526aa677a8ceb64569c9d4fb.

As the response of this request return id SHA1 hashed with a date:

  require('crypto')
    .createHash('sha1')
    .update(new Date().toDateString().toString() + id)
    .digest('hex')

What's in Query

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.

JSON Me

Write a server that reads a file (file name is passed in process.argv[3]), parses it to JSON and outputs the content to the user with res.json(object).

More Repositories

1

practicalnode

Practical Node.js, 1st and 2nd Editions [Apress] 📓
JavaScript
3,802
star
2

you-dont-know-node

You Don't Know Node.js
Python
1,504
star
3

cheatsheets

JavaScript and Node.js cheatsheets
HTML
1,341
star
4

mongoui

MongoDB admin UI server written in Node.js 🎮
JavaScript
586
star
5

react-quickly

Source code for React Quickly [Manning, 2017]: Painless Web Apps with React, JSX, Redux, and GraphQL 📕
JavaScript
540
star
6

fullstack-javascript

Source code for the Fullstack JavaScript book
JavaScript
513
star
7

react

Examples for the React Quickly book.
JavaScript
248
star
8

rest-api-express

REST API built with Express.js, Mongoskin and Mocha
JavaScript
198
star
9

rpjs

Rapid Prototyping with JS examples. Rapid Prototyping with JS is a JavaScript and Node.js book that will teach you how to build mobile and web apps fast.
JavaScript
187
star
10

nodeframework

Hand-picked registry of Node.js frameworks.
HTML
161
star
11

node-patterns

Node Patterns: From Callbacks to Observer
JavaScript
158
star
12

hackhall

Invite-only community and social collaboration platform for programmers, startupers, JavaScript professionals and pirates.
JavaScript
152
star
13

blog-express

Express.js Blog App
JavaScript
133
star
14

expressjsguide

Express.js Guide code examples
JavaScript
110
star
15

todo-express

Express.js Todo App
CSS
108
star
16

proexpressjs

Examples for the Practical Node.js book [Apress, 2014]
JavaScript
106
star
17

react-native-quickly

JavaScript
100
star
18

node-advanced

Node Advanced Courseware
JavaScript
82
star
19

super-simple-backbone-starter-kit

Super Simple Backbone Starter Kit and Boilerplate
CSS
74
star
20

http2-express

JavaScript
61
star
21

proto-buffer-api

Google Protocol Buffers Node.js/Express.js API Example
JavaScript
58
star
22

meanworks

MEANWorks: MongoDB/Mongoose, Express, Angular and Node Workshop with Angular Fullstack Generator
JavaScript
41
star
23

openlist

Open source PHP web application for ad classified websites
PHP
37
star
24

http2-node-server-push

JavaScript
23
star
25

node-in-production

JavaScript
21
star
26

editor

Collaborative Online Real-Time Code Editor
JavaScript
20
star
27

universal-web

JavaScript
14
star
28

node-react

JavaScript
13
star
29

aws-intermediate

Shell
12
star
30

codedeploy-codepipeline-node

Shell
11
star
31

es7-es8

ES7/ES2016 and ES8/ES2017 Features
JavaScript
9
star
32

react-foundation

JavaScript
9
star
33

relay-modern

Relay Modern: Declarative Data-Driven React Apps Development with GraphQL
JavaScript
8
star
34

ga-backbone

Introduction to Backbone.js
JavaScript
7
star
35

simple-message-board

Simple Message Board with Parse.com REST API and jQuery
JavaScript
7
star
36

expressapiref

Express.js Deep API Reference
JavaScript
7
star
37

state-js

State of Javascript: Overview of recent ECMAScript standard and libraries (end of 2017, early 2018)
6
star
38

node-toolchain

https://node.university/p/node-toolchain
JavaScript
6
star
39

h2-node

6
star
40

mern

JavaScript
5
star
41

node-testing

Node Testing Courseware
JavaScript
5
star
42

copy-paste

Atom package for pasting code with delay
CoffeeScript
5
star
43

graphql-apollo

CSS
5
star
44

5-reasons

JavaScript
4
star
45

weather-app

JavaScript
3
star
46

aws-intro

Build Solid Foundation of Main AWS Concepts and Services Start Learning
Shell
3
star
47

nodejs-hello-world

nodejs-hello-world
JavaScript
3
star
48

ato-2018-writting

3
star
49

azat-co

Source code for http://azat.co personal website
HTML
3
star
50

es6

3
star
51

nodejs-message-board

nodejs-message-board
JavaScript
2
star
52

vote-app

JavaScript
2
star
53

swe-coaching

Software Engineering Mastermind and Coaching
2
star
54

mongo-message-board

mongo-message-board
JavaScript
2
star
55

rpjs-co

Rapid Prototyping with JS website (<http://rpjs.co>).
HTML
2
star
56

mongoose

JavaScript
2
star
57

react-native-timer

JavaScript
2
star
58

crud-rest-api

JavaScript
2
star
59

serverless

1
star
60

globalog

Colored logs without having to type "console".
JavaScript
1
star
61

Tasks

Various Tasks
Ruby
1
star
62

twitter-stream

JavaScript
1
star
63

practicalnodebook

Website for the Practical Node.js [Apress, 2014]
HTML
1
star
64

message-board

Message Board: Backbone + Parse.com
JavaScript
1
star
65

react-start

JavaScript
1
star
66

rest-api-koa-mongo

JavaScript
1
star
67

SquareQ

Square Coding Question
1
star
68

graphql-relay

JavaScript
1
star
69

ic

Image Conversion with ImageMagick
JavaScript
1
star
70

react-16

Demo project of all things new in React 16
JavaScript
1
star
71

150x

150x.co
JavaScript
1
star
72

azatblog

CSS
1
star
73

mobile-dapp-wrapper

Like Metamask but for mobile
JavaScript
1
star
74

rn-workshop

1
star