Giter VIP home page Giter VIP logo

express-quickstart's Introduction

Express-quickstart

Express-quieckstart 是一个基于 Node.js Express Web 框架和 EasyTemplateJS 模板引擎的快速开发骨架。

Express-quieckstart is a fast development skeleton based on Node.js Express Web appliation framework and EasyTemplateJS template engine。

Express-quicker 快速生成工具/Generator tool

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

.
├── 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
...
/**
 * 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 直接基于原生 HTML 和 JavaScript 进行模板编译和渲染,并支持内嵌 JavaScript 脚本(<etj-script>...</etj-script>)和 CSS 样式脚本(<etj-script>...</etj-script>)。能更大限度发挥 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 is based on native HTML and JavaScript for template compilation and rendering, support embedded JavaScript (<etj-script>...</etj-script>) and CSS(<etj-script>...</etj-script>). To maximize the advantages of EasyTemplateJS high performance, compact and easy to use.

End

Email:[email protected]

http://www.easyproject.cn

支付宝钱包扫一扫捐助:

我们相信,每个人的点滴贡献,都将是推动产生更多、更好免费开源产品的一大步。

感谢慷慨捐助,以支持服务器运行和鼓励更多社区成员。

支付宝钱包扫一扫捐助

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.

PayPal

express-quickstart's People

Contributors

ushelp avatar

Watchers

 avatar  avatar

Forkers

guoyu07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.