express Installation
2020-04-21 本文已影响0人
晨曦Bai
官网
http://expressjs.com/en/starter/installing.html
简介
Express is a Node.js web application framework, minimal and flexible, providing a robust set of features for web and mobile applications,
providing a thin layer of fundamental web application features.
安装
precondition :
Install Node.js
- create a directory for your application
mkdir appdirec
cd appdirec
- create a package.json file
npm init
This command promptes you for a number of things, such as the name and version of you application, simply hit
return
to accept the defaults for most of them, with the following exception:
entry point: (index.js)
enterapp.js
, or whatever you want the name of the main file to be. or accept the defaultindex.js
by hittingenter
- Name the main file name(entry point)
app.js
press
enter
button in the keyboard
- Install Express in the application directory and save it in the dependencies list.
npm install express --save