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以及如何着重强调如何构建所有必需文件的全新结构来启动Express应用程序。

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

Express生成器自动为Express应用程序生成标准结构或模板。

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是一种工具,可以帮助我们使用一些代码来构建Express应用程序的标准结构或模板。

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.

做记录! 您应该在计算机中安装Node js。

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

在Node.js已经启动并运行的情况下,让我们开始吧。

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

我们看到了结构的外观,并生成了一个名为myapp的项目示例。

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

现在,让我们解释应用程序结构的含义:

  1. 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文件夹包含一个文件,该文件包含一些服务器详细信息,例如端口号,所需的模块和一些基本的错误处理。 该文件主要带有名称www。

    - Changes are rarely made in this folder.

    -在此文件夹中很少进行更改。

  2. 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,如下所示。

  3. 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.

    路由:路由是一个术语,描述了使用单独的网页或文档创建不同子域的技术。 例如,一条路线可以是... / home,... / blog,... / about和... users

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

    文件夹路由存储各种路由文件。 默认情况下,Express Generator会配置2个路由文件,分别是

    index.js and users.js.

    index.jsusers.js

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

    视图:视图是如何使用模板引擎以html形式呈现数据。

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

    如果未配置任何特定的模板引擎,则默认情况下它将使用玉器(也称为pug)。

  5. 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应用程序文件。 它需要所有必需的模块,连接文件路由,连接到模板引擎或视图,连接到中间件。

  6. 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文件是包含有关您的应用程序的准确详细信息的文件。 它包含详细信息,例如作者,名称,版本,依赖项等。

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.

感谢您与我一起编码。 非常欢迎您发表评论。

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

express 项目生成器

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

  1. 09_Android中ContentProvider和Sqllite混合操作,一个项目调用另外一个项目的ContentProvider

    1.  编写ContentPrivider提供者的Android应用 清单文件 <?xml version="1.0" encoding="utf-8"? ...

  2. python的装饰器迭代器与生成器_详解python中的生成器、迭代器、闭包、装饰器

    迭代是访问集合元素的一种方式.迭代器是一个可以记住遍历的位置的对象.迭代器对象从集合的第一个元素开始访问,直到所有的元素被访问完结束.迭代器只能往前不会后退. 1|1可迭代对象 以直接作用于 for ...

  3. 利用python提取abaqus节点坐标的脚本_用于在Abaqus中提取结点力的Python程序

    用于在Abaqus中提取结点力的Python程序 #coding=utf-8 from abaqus import * from abaqusConstants import * from odbAc ...

  4. 开源规则_开源项目的10条规则

    开源规则 1.不完整总比没有好 (1. Something incomplete is better than nothing at all) If you have a piece of code ...

  5. zigbee 串口不稳定_基于项目的ZigBee系统组网介绍

    关于ZigBee的资料之前陆陆续续发过一些,主要以技术文档介绍为主,在项目案例介绍中多以设备实际应用为主.但仍感不够详细,恐对大家造成困惑,故今以ZigBee技术为核心,三层别墅为蓝本进行一下介绍. ...

  6. 【Flask项目】项目准备之-创建项目的APP对象

    项目目录 settings目录: 负责整个项目的配置信息:数据库配置.日志的配置.开发环境的配置信息 class Config:#配置数据库和SQLALchemyHOSTNAME = '127.0.0 ...

  7. github上的linux项目,克隆GitHub上项目的非Master分支

    问题来了 项目现在Github上有两个分支,分别是 master 和 gh-pages,其中master没什么东西,代码都在gh-pages分支上,而我现在想要克隆gh-pages分支上的东西,咋办呢 ...

  8. python枚举类的意义_用于ORM目的的python枚举类

    编辑问题 我正在尝试创建一个类工厂,它可以生成具有以下属性的枚举类: >从列表中初始化类 允许值(即,它) 自动生成!). > Class创建自己的一个实例 对于每个允许的值. >类 ...

  9. java redis id生成器_基于redis的分布式ID生成器

    项目地址 基于redis的分布式ID生成器. 准备 首先,要知道redis的EVAL,EVALSHA命令: 原理 利用redis的lua脚本执行功能,在每个节点上通过lua脚本生成唯一ID. 生成的I ...

最新文章

  1. 河南城建学院linux期末试题,河南城建学院09-10(上)期末试题.ppt
  2. 解决数据库里表字段带下划线,实体类转小驼峰,Mapper的映射问题
  3. java多线程------实现多线程两种方式
  4. java异常什么时候抛出异常,java - 什么时候应该抛出IllegalArgumentException?
  5. java随机产生密码_用Java生成随机密码的方法
  6. python 系统学习实例1.1 - 华氏度与摄氏度的转换
  7. 请简述gouraud光照模型_《计算机图形学》试卷及答案
  8. Java 集成freeotp_Java Token.setImage方法代碼示例
  9. Java8-初识Lambda
  10. Python:time库使用方法
  11. 对于目前流行的量化投资与smart beta策略的一些看法
  12. Swift 获取字符的个数 、字符串的遍历
  13. ssm-学子商城-项目第五天
  14. TcaplusDB X 光与夜之恋|你的恋爱我来守护
  15. 学大伟业:学习物理竞赛的学生如何快速掌握所需要的高数知识?
  16. Matlab求解空间曲线的切线和法平面
  17. 怎样对php手册解除锁定,word锁定怎么解锁
  18. P4578 [FJOI2018]所罗门王的宝藏
  19. 看我如何拿下BC站的服务器
  20. 基于MDK-KILE5.23版本的STM32创建工程

热门文章

  1. 在linux上面找一个脚本,30个Linux Shell脚本经典案例
  2. Python二级笔记(10)
  3. pppoe linux 配置文件,linux PPPOE服务端配置
  4. linux下qq怎么截图,ubuntu 12.04使用QQ截图安装教程
  5. Oracle GoldenGate微服务架构
  6. python install zabbix.4.0
  7. 求方程的解 Solve the Equation
  8. PHP Smarty template for website
  9. 如何安装Genymotion虚拟机以及Genmotion的eclipse插件
  10. 连接postgresql