JavaScript Programming/Node.js REST API

This lesson introduces Node.js, Express.js and REST APIs.

Objectives and Skills edit

Objectives and skills for this lesson include:

  • Understand Node.js concepts
  • Understand Express.js concepts
  • Use Node.js and Express.js to implement a simple REST API

Readings edit

  1. Wikipedia: Node.js
  2. Wikipedia: Express.js
  3. Wikipedia: REST API

Multimedia edit

Examples edit

Activities edit

  1. Install Node.js
  2. Configure and test Express.js
    • Create a new folder for your REST server application. In that folder, run the following command to generate an Express.js template:
          npm install express-generator
    • Install Express and CORS using the following commands:
          npm install express --save
          npm install cors --save
    • Copy the Hello World example code to create a simple Express.js website.
    • Start the website using the command:
          node server.js
    • Test your server by using your web browser to navigate to:
          http://localhost:3000
  3. Create a simple REST API

Lesson Summary edit

  • Bullet points

Key Terms edit

term
definition

See Also edit

References edit