Express is a fast unopinionated, minimalist web framework for nodejs Authored by TJ Holowaychuk Express is a framework for building robust http servers, single page applications and API's among others. How to create an http server in express Open your text editor and terminal, run the commands below to create a project directory, application file and a landing page mkdir project cd project mkdir static echo "Hello World" > static index.html touch app.js You must have a directory structure as follows; |Project/ |static/ |index.html |app.js Project directory is the root directory of the application Static directory is where static files, webpages will be stored. index.html is an index page with text "Hello world". app.js is a blank JavaScript file, open your editor and paste the following few lines of code into app.js import express from 'express' const a...
Comments
Post a Comment