什么是Express.js? [英] What is Express.js?

查看:105
本文介绍了什么是Express.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Node.js 的学习者。


  1. 什么是 Express.js

  2. Node.js的目的是什么?

  3. 为什么我们实际上需要Express.js?什么是我们与Node.js一起使用?

  4. 什么是 Redis的?它是否与Express.js一起使用?

  1. What is Express.js?
  2. What is the purpose of it with Node.js?
  3. Why do we actually need Express.js? How it is useful for us to use with Node.js?
  4. What is Redis? Does it come with Express.js?


推荐答案

这是过度简化, href =https://en.wikipedia.org/wiki/Express.js =noreferrer> Express.js 是 Node.js Ruby on Rails Sinatra Ruby

This is over simplifying it, but Express.js is to Node.js what Ruby on Rails or Sinatra is to Ruby.

Express 3.x是一个轻量级的Web应用程序框架帮助您将Web应用程序组织到服务器端的MVC架构中。您可以使用各种模板语言的选择(如 EJS Jade Dust.js ) 。

Express 3.x is a light-weight web application framework to help organize your web application into an MVC architecture on the server side. You can use a variety of choices for your templating language (like EJS, Jade, and Dust.js).

然后,您可以使用数据库,如 MongoDB Mongoose (用于建模)为您的节点提供后端。 js应用程序Express.js基本上可以帮助您管理一切,从路由到处理请求和视图。

You can then use a database like MongoDB with Mongoose (for modeling) to provide a backend for your Node.js application. Express.js basically helps you manage everything, from routes, to handling requests and views.

Redis是一个键/值存储 - 通常用于Node.js中的会话应用。你可以做更多的事情,但这是我正在使用它。我使用MongoDB进行更复杂的关系,例如订单项< - >订单< - >用户关系。有一些模块(最值得注意的是connect-redis),它将与Express.js一起使用。您需要在服务器上安装 Redis 数据库。

Redis is a key/value store -- commonly used for sessions in Node.js applications. You can do a lot more with it, but that's what I'm using it for. I use MongoDB for more complex relationships, like line-item <-> order <-> user relationships. There are modules (most notably connect-redis) that will work with Express.js. You will need to install the Redis database on your server.

以下是Express 3.x指南的链接: http:// expressjs .com / guide.html

Here is a link to the Express 3.x guide: http://expressjs.com/guide.html

这篇关于什么是Express.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆