官术网_书友最值得收藏!

Creating a Node.js application

To start off a sample Node.js project, simply create a project folder first and then run the following command from that folder:

npm init

On running this command, Node will prompt you with a series of questions, which you can either fill or leave blank:

Once the blank application is created, all you see is a file called package.jsonYou can now add the dependencies that are needed to create the Node.js application:

npm install body-parser express --save

The body-parser module helps with parsing of the POST request body, whereas the express module helps with the creation of the Node.js server.

主站蜘蛛池模板: 开阳县| 淅川县| 于都县| 贵州省| 柞水县| 嘉荫县| 聂拉木县| 扎囊县| 新乡市| 鄂托克前旗| 肥城市| 杭锦后旗| 新宾| 武汉市| 诏安县| 新营市| 耿马| 舒城县| 景东| 同心县| 龙海市| 德昌县| 平罗县| 小金县| 深泽县| 佳木斯市| 建宁县| 沁源县| 师宗县| 隆昌县| 松阳县| 枣庄市| 佳木斯市| 大方县| 庆云县| 米脂县| 连山| 克拉玛依市| 贵港市| 敦化市| 三穗县|