五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Bilingual Express tutorial in English and Chinese (中英雙語 Express

2023-08-17 20:10 作者:前端艾佛森  | 我要投稿


1. Introduction 介紹

Express is a fast, unopinionated, minimalist web framework for Node.js
Express 是一個快速的、靈活的、極簡的 Nodejs 開發(fā)框架

Fast 快速的

You can use it easily and quickly.
它很簡單,你可以快速上手

unopinionated 靈活的

An unopinionated framework gives developers more control and the ability to shape their software according to their own preferences, while an opinionated framework provides a more structured and standardized approach to development.
一個靈活的框架會將項目的控制權(quán)交給開發(fā)者,允許他們根據(jù)自己的實際需求定制項目功能.
然而,一個“強約束”的框架會有很多的代碼組織標(biāo)準(zhǔn)來約束開發(fā)者

minimalist 極簡的

You can create a Nodejs server by a few lines of code.
你可以使用很少的代碼,就能創(chuàng)建一個 Nodejs 服務(wù)


2. Create An Express Application(搭建 Express 項目)

If you want to create a Nodejs server useing Express,you need to set up an Express project first.?Express provides a tool called “express-generator” which allows you to set up an Express Application quickly.
如果你想基于 Express 搭建一個 Nodejs 服務(wù),你需要先初始化一個 Express 項目。Express 為我們提供了一個名為“express 生成器”的工具,我們可以使用這個工具快速搭建 Express 項目。

Next,Let's finger out how to use "express-generator"
接下來我們演示一下,如何使用“express 生成器”

Step1

Use npm to install "express-generator" globally in your computer
使用 npm 在你的電腦上全局安裝 express-generator

npm i express-generator -g

Step2

Use the express command to set up your Express Application
使用 express 命令創(chuàng)建 express 項目

express --no-view --git express-project

  • --no-view means do not use any template engine such as "ejs".By default, generator will choose a template engine to render the data.

  • --no-view 意思是:不使用任何模板引擎。默認(rèn)情況下 generator 生成器會自己選一個模板引擎來渲染數(shù)據(jù)。

  • --git means create a .gitignore file by default

  • --git 可以讓生成器幫我們創(chuàng)建一個.gitignore 文件

  • express-project is your own project name

  • express-project 是自定義的項目名稱

Step3

Now, we can see an application named "express-project" there. We need to start it up by useing the followling commands.
這個時候,我們可以看到一個名為 express-project 的項目已經(jīng)創(chuàng)建好了。我們還需要使用下面的命令啟動它。

1. Please make sure to excute the following commands in the directory of your application.請確保在你自己的項目目錄下,執(zhí)行下面所有命令.

????cd express-project

2. Install all the dependencies useing Npm

使用 npm 安裝項目所需依賴

npm i

3. Start it up? ?啟動項目

npm run start

4. Try to access 'http://localhost:3000' in your browser.If you can see some words like 'Express,Welcome to Express',it means your Node server has started up successfully. Congratulations!

嘗試在瀏覽器中訪問 http://localhost:3000,如果看到類似“Express,Welcome to Express”的字樣。說明你已經(jīng)成功啟動了 Node 服務(wù)。恭喜你!

Use WeiXin to Scan The Qrcode 微信掃描二維碼

There are many different IT courses in this miniprograme,such as,IoT,AI,Big Data,Backend Development,Frontend Development,UI and more. Please scan it and enjoy yourself.
在這個微信小程序中,有很多不同類型的 IT 課程,例如:物聯(lián)網(wǎng)、人工智能、大數(shù)據(jù)、后端開發(fā)、前端開發(fā)、UI 設(shè)計等。請掃碼盡情觀看學(xué)習(xí)吧。

海量IT知識免費學(xué)習(xí)



Bilingual Express tutorial in English and Chinese (中英雙語 Express 的評論 (共 條)

分享到微博請遵守國家法律
大同县| 常德市| 双牌县| 信丰县| 长武县| 株洲市| 安宁市| 盱眙县| 商水县| 浦县| 南充市| 道孚县| 扶风县| 太原市| 安义县| 亳州市| 巴塘县| 桦南县| 马关县| 贵南县| 莎车县| 山阳县| 和政县| 皮山县| 民丰县| 德兴市| 五莲县| 鄂托克旗| 平遥县| 自治县| 桐柏县| 同德县| 扶风县| 石狮市| 衡山县| 南京市| 乐都县| 宁波市| 将乐县| 比如县| 凤凰县|