GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main Page
  • Browse
  • Recent changes
  • Guided tours
  • Random
  • Help
  • Portal
  • Colloquium
  • News
  • Projects
  • Sandbox
  • Search
  • Donate
  • Create account

This view

  • Original page
  • New address

GeezerVison is showing en.wikiversity.org — JavaScript Programming/Node.js REST API - Wikiversity

< JavaScript Programming

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

Objectives and Skills

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

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

Multimedia

Examples

  • W3Schools: Node.js Tutorial
  • W3Schools: RESTful Web Services
  • Hello World
  • REST API

Activities

  1. Install Node.js
    • Review Medium: Building a simple REST API with NodeJS and Express.
    • Download and install Node.js
    • Use a command prompt or terminal window to verify Node.js installation:
          node -v
          npm -v
  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
    • Copy the REST API example code to create a REST API website.
    • Start the website using the command:
          node server.js
    • Revise your JavaScript Programming/AJAX and JSON project to send data to your Express.js server.

Lesson Summary

  • Bullet points

Key Terms

term
definition

See Also

References

← Libraries and Frameworks
JavaScript Programming
Retrieved from "https://en.wikiversity.org/w/index.php?title=JavaScript_Programming/Node.js_REST_API&oldid=2269895"
Categories:
  • JavaScript Programming
  • Node.js
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.