Skip to content

yayinternet/module-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS Module examples

simple-modules

  • Directory with several simple modules
  • The main script is scripts.js and only requires print-util.js
  • Examples explained in Lecture 25
  • To run:
    • In your terminal, navigate to the module-examples/simple-modules/ directory
    • Run $ node scripts.js
  • Try loading the other modules (e.g. function-module.js) by changing the require statement in scripts.js. See Lecture 25 for more details.

simple-middleware

  • Simple server with middleware function that runs on each request
  • Example explained in Lecture 25
  • To run:

dictionary-with-routes

  • Dictionary lookup example with server-side rendering using Handlebars, organized in different files via NodeJS modules and Express routes
  • Each word in the dictionary has its own page, like http://localhost:3000/dog
  • Example explained in Lecture 25
  • To run:
    • In your terminal, run $ mongod. Keep that process running and don't close the terminal.
    • Create a second terminal window. In this terminal window, navigate to the dictionary-server-side/ directory
    • Run $ npm install
    • Run $ npm start
    • View the running app at http://localhost:3000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published