https://github.com/ushelp/express-quickstart
Node.js Express development skeleton based on EasyTemplateJS engine.
https://github.com/ushelp/express-quickstart
express-quieckstart javascript node node-express node-express-start nodejs nodejs-express nodejs-expressjs template-engine
Last synced: 5 months ago
JSON representation
Node.js Express development skeleton based on EasyTemplateJS engine.
- Host: GitHub
- URL: https://github.com/ushelp/express-quickstart
- Owner: ushelp
- License: mit
- Created: 2017-06-27T04:58:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-13T06:18:32.000Z (over 6 years ago)
- Last Synced: 2025-07-14T06:31:42.621Z (6 months ago)
- Topics: express-quieckstart, javascript, node, node-express, node-express-start, nodejs, nodejs-express, nodejs-expressjs, template-engine
- Language: HTML
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Express-quickstart
**Express-quieckstart** 是一个基于 Node.js [Express](http://expressjs.com/ "Express - Node.js web application framework") Web 框架和 [EasyTemplateJS](https://github.com/ushelp/EasyTemplateJS "EasyTemplateJS") 模板引擎的快速开发骨架。
Express-quieckstart is a fast development skeleton based on Node.js [Express](http://expressjs.com/ "Express - Node.js web application framework") Web appliation framework and [EasyTemplateJS](https://github.com/ushelp/EasyTemplateJS "EasyTemplateJS") template engine。
## Express-quicker 快速生成工具/Generator tool
[Express-quicker](https://github.com/ushelp/Express-quicker "an application generator tool for Express-quicker") 是一个针对 `express-quickstart` 应用程序快速生成命令行工具。
`express-quicker` is an application generator tool, to quickly create an application skeleton use `express-quickstart` .
- 安装命令行工具 / Installs command-line tool:
```
npm install express-quicker -g
```
- 创建 Express-quickstart 项目 / Creates an Express-quickstart app:
```
equicker [app-name]
```
- 安装依赖 / Then install dependencies:
```
npm install
```
- 启动 / Startup:
```
npm start
```
- 访问 / Load:
`http://localhost:3000/`
## 基础集成组件 / Basic integration components
- CORS
- Cookie
- Session(Cookie/Redis)
- Logging(Morgan&Winston)
- Body-parse
- Multer
- Method-override
- Serve-favicon
- Compression
- Exception Handler
## 目录结构 / directory structure
```sh
.
├── app.js
├── package.json
├── public
│ ├── img
│ ├── js
│ └── css
│ └── style.css
│ └── favicon.ico
│ └── upload.html
├── routes
│ ├── index.js
│ └── users.js
├── uploads
└── views
├── error.etj
├── index.etj
└── users.etj
7 directories, 10 files
```
## 模板引擎缓存控制 / Template engine cache control
缓存有利于渲染性能,但在开发或调试模式时,可以将 `cache` 设置为 false,以便无需重启,刷新即可观察修改.
Caching is useful for rendering performance, but in development or debug mode, you can set `cache` to false so that you can refreshing toobserve changes without restarting.
- **app.js**
```JS
...
/**
* Template Engine (EasyTemplatJS)
*/
var fs = require('fs')
var Et = require('easytemplatejs');
//var cache = true; // Use Cache?
var cache = process.env.NODE_ENV == 'production'; // Use Cache?
...
```
## 为何选择 EasyTemplateJS? / Why choose EasyTemplateJS?
Pug 等模板引擎带有自定义语言,需要高昂的学习成本,并且引擎内部需要对模板进行转换。
而 [EasyTemplateJS](https://github.com/ushelp/EasyTemplateJS "EasyTemplateJS") 直接基于原生 HTML 和 JavaScript 进行模板编译和渲染,并支持内嵌 JavaScript 脚本(`...`)和 CSS 样式脚本(`...`)。能更大限度发挥 EasyTemplateJS 高性能,小巧并简单易用的优势。
Pug and other template engine with a custom language, the need for high learning costs, and the need for internal transformation of the template template.
[EasyTemplateJS](https://github.com/ushelp/EasyTemplateJS "EasyTemplateJS") is based on native HTML and JavaScript for template compilation and rendering, support embedded JavaScript (`...`) and CSS(`...`). To maximize the advantages of EasyTemplateJS high performance, compact and easy to use.
## End
Email:
[http://www.easyproject.cn](http://www.easyproject.cn "EasyProject Home")
**支付宝钱包扫一扫捐助:**
我们相信,每个人的点滴贡献,都将是推动产生更多、更好免费开源产品的一大步。
**感谢慷慨捐助,以支持服务器运行和鼓励更多社区成员。**

We believe that the contribution of each bit by bit, will be driven to produce more and better free and open source products a big step.
**Thank you donation to support the server running and encourage more community members.**
[](https://www.paypal.me/easyproject/10 "Make payments with PayPal - it's fast, free and secure!")