日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

express 项目生成器_用于项目的Express模板生成器(2)| 应用程序结构研究

發(fā)布時間:2025/3/11 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 express 项目生成器_用于项目的Express模板生成器(2)| 应用程序结构研究 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

express 項目生成器

Hello! In express template generator for your projects (1), we looked at express generator and how we can start an express application with stressing to build a brand new structure of all required files.

你好! 在針對您的項目的Express模板生成器(1)中 ,我們研究了Express Generator以及如何著重強(qiáng)調(diào)如何構(gòu)建所有必需文件的全新結(jié)構(gòu)來啟動Express應(yīng)用程序。

Express generator automatically generates a standard structure or template for an express application.

Express生成器自動為Express應(yīng)用程序生成標(biāo)準(zhǔn)結(jié)構(gòu)或模板。

Express generator is a tool that helps us build a standard structure or template of the express application with some code to start up.

Express Generator是一種工具,可以幫助我們使用一些代碼來構(gòu)建Express應(yīng)用程序的標(biāo)準(zhǔn)結(jié)構(gòu)或模板。

It includes all required modules and dependencies which you'll later install and use.

它包括所有必需的模塊和依賴項,您將在以后安裝和使用。

Take Note! You should have Node js installed in your computer.

做記錄! 您應(yīng)該在計算機(jī)中安裝Node js。

With Node.js already up and running, let's get started.

在Node.js已經(jīng)啟動并運(yùn)行的情況下,讓我們開始吧。

We saw how the structure looks like and generated a project example called myapp.

我們看到了結(jié)構(gòu)的外觀,并生成了一個名為myapp的項目示例。

Now, let's explain the meaning of the application structure:

現(xiàn)在,讓我們解釋應(yīng)用程序結(jié)構(gòu)的含義:

  • The Bin folder contains a file that contains some server details like port number, required modules and some basic error handling. The file mostly comes with the name www.

    Bin文件夾包含一個文件,該文件包含一些服務(wù)器詳細(xì)信息,例如端口號,所需的模塊和一些基本的錯誤處理。 該文件主要帶有名稱www。

    - Changes are rarely made in this folder.

    -在此文件夾中很少進(jìn)行更改。

  • The Public folder: As the name implies, it's a folder for public use. Therefore, all the resources used or viewed by your users are stored in this folder. These resources could be images, JavaScript and CSS as seen below.

    公用文件夾 :顧名思義,它是供公眾使用的文件夾。 因此,您的用戶使用或查看的所有資源都存儲在此文件夾中。 這些資源可以是圖像,JavaScript和CSS,如下所示。





  • Routes: Routing is a terms that describes the technique of creating different sub domains with separate web pages or documents. For example, a route could be .../home , .../blog ,.../about and ...users.

    路由:路由是一個術(shù)語,描述了使用單獨(dú)的網(wǎng)頁或文檔創(chuàng)建不同子域的技術(shù)。 例如,一條路線可以是... / home,... / blog,... / about和... users 。

    The folder route stores the various route files. By default express generator configures 2 route files which are

    文件夾路由存儲各種路由文件。 默認(rèn)情況下,Express Generator會配置2個路由文件,分別是

    index.js and users.js.

    index.js和users.js 。





  • Views: views are how data can be rendered in html using template engines.

    視圖:視圖是如何使用模板引擎以html形式呈現(xiàn)數(shù)據(jù)。

    If no specific template engine is configured, it uses jade also known pug by default.

    如果未配置任何特定的模板引擎,則默認(rèn)情況下它將使用玉器(也稱為pug)。

  • App.js: app.js is the main file that is initiated at the command prompt. It’s the main express application file that joins all other parts together. It requires all required modules, connects file routes, connects to template engine or views, connects to middleware.

    App.js: app.js是在命令提示符下啟動的主文件。 這是將所有其他部分連接在一起的主要Express應(yīng)用程序文件。 它需要所有必需的模塊,連接文件路由,連接到模板引擎或視圖,連接到中間件。





  • Package.json file: The package.json file is a file with accurate details about your application. It contains details such as author, name, version, dependencies, etc.

    Package.json文件: package.json文件是包含有關(guān)您的應(yīng)用程序的準(zhǔn)確詳細(xì)信息的文件。 它包含詳細(xì)信息,例如作者,名稱,版本,依賴項等。

  • Below is an example of a package.json file for an express generated project.

    以下是快速生成的項目的package.json文件的示例。

    Thanks for coding with me. Your comments are most welcome.

    感謝您與我一起編碼。 非常歡迎您發(fā)表評論。

    翻譯自: https://www.includehelp.com/node-js/express-template-generator-for-your-projects-2-a-study-of-the-application-structure.aspx

    express 項目生成器

    總結(jié)

    以上是生活随笔為你收集整理的express 项目生成器_用于项目的Express模板生成器(2)| 应用程序结构研究的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。