Skip to content

imranhsayed/express-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express App

Description 📋

A demo app for express

Installation 🔧

  1. Clone this repo in git clone https://github.com/imranhsayed/express-app
  2. git checkout branch-name

Branch Information 💻

The express.static() middleware that comes shipped with express, automatically servers the index.html on root url '/' without having to create a route using app.get( '/' )

app.use( express.static( 'public' ) )
  • Creates a custom middleware called loggerMiddleWare.
  • Run npm run dev
  • Open browser at http://localhost:5000
  • Every time you refresh the page, a GET request to http://localhost:5000/ is made and the middleware intercepts that request and when the response for that request is finished it calculates the time it took for that request to complete and prints that.

LoggerMiddleWare Demo 📹

Common Commands 💻

  • npm run dev Starts Node server at http://localhost:5000

Releases

No releases published

Packages

No packages published