Node.js与Sails~项目结构与Mvc实现
Sails是一个Node.js的中间件架构,帮助我们很方便的构建WEB应用程序,网址:http://www.sailsjs.org/,它主要是在Express框架的基础上发展起来的,扩展了新的功能组件,下面我们来看一下安装方法
一 安装Sails
npm -g install sails
二 建立一个Sails的项目
sails new testProject
三 启动项目
cd testProject
sails lift
四 项目的结构,基于MVC理念
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeMAAAGtCAIAAACqR4tzAAAgAElEQVR4nO3df28d133n8fvfPoE+gKJPIV2IFwWSrKUixXrR5RrYFpAlNXGTqWkkSoBIshPYuIpSxHYLDdhCYdEyRWCuXAo2d9tIxEWFlSFTNorFxjTqHyuCd+HaQRTaIrrNEkUAgb+mf8zcmXNmzpkfd+7MfGfu+4WDmBzO3DuXIT/86szc8+15AAB5Xn7xe48ePfr0008//fTTXtMnAwAw8JN6Z2dnZ2eHpAYAiV5+8Xu3bv7EH1NL6jeWnoqNf/rpT6b14M0Yuf1er++Oqn+mz+4uvnT3YfXP0woPb1977vxrHzZ9GhNr+/knTfkVvffac6/cn9aDddrLL37v/49VmNS5w3rolArExOEjt9+LTP7Ikyd1sVd0f/X8tTc+i2154Tvf9If9N8SY7++99lyeY5unvsbnV9+LvhDPhc/uLp5/4TvffH7CX+8p/hXMFzHZuWY7pZIRljx8Sj8Mkye15RV9+Mrzi7epTDJZk/qyXeaDGpPaOBKHVpLUzjD84vjj+hR5RR++ouWU591fPR/bknJsLOK1342Ht689J7dUv79a6Je/RIoZvkuTmV4xaD6lKpK62R8G6ysq+P/+jEpLauMB1SX10OlponiLvmLaFqSv+XA1qaPQHLn9Xt91HfV4/SGCJ7KW5KZTUvdOOSW7+I/sw9vXbL+uhl+21F9O77O7i8GD31996e6Ht689d/6F73wzKmceBlu0gkvZ+MJ3vukHivFwQ+H/4SvXVl+59tz55xdv3109n17HmX5XU8rntILRePJKFJq/S3ffeCm+Z9Y3RDmx5LNHW55X/2/Kd0rqN1P/R0aul2k5vOQPg+UVG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kI6kBgDpSGoAkI6kBgDpSGoAkI6kBgDpSGoAkI7uXAAgHd25AEA6unMBgHTMUwOAdCQ1AEinJvW/AY2nGAIQ65ujAAAAAElFTkSuQmCC" alt="" />
我们可以看到它与是由model,view,controller组成,它们之间的调用关系与.net mvc十分类似,只不过.net mvc里的model主要是指viewmodel,而在sails里model主要是数据模型,即.net里的Entity,它是数据表的一种抽象,对于数据的持久化,sails提供了很多种,如本地文件,mysql,mongodb,redis等,对于sqlserver我们也可以找到第三方的组件。
五 通过controller的action来渲染视图
我们在.net mvc里,大家都知道视图是通过action的render方法进行渲染的,其时sails也是这样的,可以使用原生的render,也可以使用封装好的view方法,而在视图上直接使用你的action返回的对象即可。
controller/action的内容
module.exports={
index: function (req, res){
return res.view("test/index",{title:"大叔",engTitle:"Lind"});
//return res.view("view_name",data)//view_name参数为空表示用当前的action
}
};
view-ejs的内容
<p>从action返回的对象-title:<%=title%></p>
<p>从action返回的对象-engTitle:<%=engTitle%></p>
调用的结果如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAACICAIAAAAgWRTLAAAc6klEQVR4nO2d+VsUV7rH+//wd+/z3Mcbnpk7M5lsdzLrnck2kxuzpx3HJCYxUWNMHIOjEjFqOxqcJBoTBSSAbAIFLZsgtijQDU2v1QtLA4JChN431kzdH6ppajl16lSzy/t53sen+9TZz3u+Z+nGVg32uwf73QMeV3+fq7fH0dXVUdd0IxAMxeIT0Vgcb/lFpUVlFZgIsYmJSDzeaXX9MO6fnp758ccf//3vfzMAAKx6VIMe96DHPdDn8vQ4e9x0bUNjb//AxORkNBbD29ETp9IefvKhXzz5zXc5mGgTU1MjP3jNdM/k1NTM7KxYGuLxuMPhaG5u1mq1Wq22ubnZ4XDE4/EV6Q4AAFhUgx73gMfd3+fq63HYbeaC0kp2vxCJxjB29MSpX/766Wde+ttTm7f87PHfhyNRqZjRWHxycrqhpSMYjkzPsBuH+eLv3r179erVtrY2k8nkdDpNJpPH46mqqtJqtcPDw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apN4uojQgRUdWSpDwR4BSE/Un7x1yDDG7Bsn1X7EzYCqPg+SuAel4mN5IxqfU6+AaUuzKOOeTWsslVWMuSJE3CONzx0hUGJk04GcUNxoXwVNxfKkI+EDZDMVPBTXEREaA2FJwhVeqP1eHNOAqjyNVaZDoDUHs9XCgwEwevgtSas6g8HxCtpsUeoM4hFOcAmkg3zvIzkx8iFJpIM9BvHFIZdeAuxLA9yf6mEiS8aJJQwr3GfLlSNVQujcE2T3w0oB3eu5rsWhK7RoQrNCugXyJXh5pwCiU7FQXi4ICdcBd/eF3DTLuv1y7hlRmoagc4YemsGvARpJz0GQIf4AotUp418B/KxyUZLeKP+NCjRDvKCe6a5CRhhTWVeGOVYRsfGSemLf4yOKykDGJ28i7DGIYWqMm60/+Zn5xDhSKnQFT+WQt5K8hxZ6iTBp4Pimo0hpD3mkULn1cN1Fr2DfC2yypvSfnalfS8aQvxxGlqCkG/ZU3wcwhnO1K5y0muUqhMEnFF9cTGVNKmEQgBwjbn8KpI3jPyVC0EEgPKyPlDMKPL0TbRsn8UNKA+LqmhLNyHsh6F+eTC41a3PC1gvwGFfOW8BGARGmPKdWR5UH0ZcG1vIcGOMB8BhYKf3Vdsm+zA8sLSAMAAAhAGgAAQADSAAAAApAGAAAQgDQAAIAApAEAAAQgDQAAIABpAAAAAUgDAAAI/h+k9HazsmFbwwAAAABJRU5ErkJggg==" alt="" />
如果进入index页面可以直接写控制器名称
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATUAAACWCAIAAAAwgoinAAAah0lEQVR4nO1d+1cb152fv2dPd33ObtttNsm223a7bZqkTeM4cRK5qV9JnBjXdeISXCd+20rsOKldN4mNMRbY2BgYkHmDEAYMmDd6gEBCTyQQkpDQi9c52h8kxLzunTsSj8H5fs7n5Eh3vvfe73y/38/cO2OiodxOKxAIlCepSecEEAiUJ6lJxwQQCJQnKZfDQkiH3Ww06jo6O5tbH9U1adR1jeq6xtomTXPro47OToNh2GE3k48GBAJFSbnsZlF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AVA/fhLm8DhRxPSJ8Cf+CEKFbGAdHqYjzXVSr4Jy4J4vslzFfCQwBBSI2YVDFvDHh/XrO+/6D4fQOICpAt2OvMuv0R5vcSoE8AQL4AfQIA8gXoEwCQL0CfAIB8AfoEAOQL0CcAIF+APgEA+QL0CQDIF6BPAEC+AH0CAPIF6BMAkC9AnwCAfPH/2rYD/V76kJAAAAAASUVORK5CYII=" alt="" />
如果其它action希望走/test这样的路由,需要在config/route.js里进行配置,如为add这个action添加路由为/user,它的设置如
'get /user': {view: 'user/add',locals: {layout: null}},
'get /test':{view:'test/index',locals:{layout:null}}
好了,到这样一个最简单的MVC的DEMO就做好了,下一节我们将引用Model,即数据持久化的机制,进行对数据表的curd操作,敬请期待...
Node.js与Sails~项目结构与Mvc实现的更多相关文章
- Node.js Express+Mongodb 项目实战
Node.js Express+Mongodb 项目实战 这是一个简单的商品管理系统的小项目,包含的功能还算挺全的,项目涵盖了登录.注册,图片上传以及对商品进行增.删.查.改等操作,对于新手来说是个很 ...
- Node.js与Sails~自定义响应体responses
回到目录 在Node.js里,你可以控制请求和响应,自己可以定义自己的响应方式,如对文本如何响应,对json如何响应,对图像流如何响应等等,而这些在Sails架构里,变得更加容易和清晰了,它位于项目的 ...
- 开启第一个Node.js的Express项目
手动创建一个Express.js的应用可大致分为以下步骤: 1.创建文件夹 a. 创建一个项目根文件夹,如helloWord b.在项目的根目录下创建项目的目录结构,依次创建{public,publi ...
- Vue.js系列之项目结构说明
转:https://www.jb51.net/article/111658.htm 前言 在上一篇项目搭建文章中,我们已经下载安装了node环境以及vue-cli,并且已经成功构建了一个vue-cli ...
- Node.js入门:包结构
JavaScript缺少包结构.CommonJS致力于改变这种现状,于是定义了包的结构规范(http://wiki.commonjs.org/wiki/Packages/1.0 ).而NPM的 ...
- 创建Node.js TypeScript后端项目
1.安装Node.js扩展,支持TypeScript语法 npm install -g typescript npm install -g typings 2.创建项目目录project_fold ...
- 总结在Visual Studio Code创建Node.js+Express+handlebars项目
一.安装node.js环境. Node.js安装包及源码下载地址为:https://nodejs.org/en/download/ 32 位安装包下载地址 : https://nodejs.org/d ...
- 实践node.js构建vue项目
一.首先安装下载node.js 1.Node.js 官方网站下载:https://nodejs.org/en/,自行选择合适自己的下载安装即可 2.验证安装 打开cmd,输入node –v和 npm ...
- Node.js之sails框架
先开一坑,有空更新,记录最近钉钉项目上对node及sails框架的学习记录和理解
随机推荐
- 讲解版的导航高亮(新手福利)原生JS
1.先写样式: 导航的排版样式: 导航对应高亮样式: .d6000f{ background:red; } .d6000f a{ color:#fff; } 我这个地方导航高亮样式为背景红色,字体颜色 ...
- UML类图6种关系的总结
http://www.open-open.com/lib/view/open1328059700311.html
- C语言小练习四
题目要求:输入N个数,输出该数列中第k个最大者. 程序源码: #include <stdio.h> #include <string.h> void printResult(i ...
- sublime text3使用小结
一.下载 http://www.sublimetext.com/2 sublime text2下载页 http://www.sublimetext.com/3 sublime text3下载页 ...
- 浅谈城市规划在移动GIS方面的应用发展
1.概述 城市建设进程加快,城市规划管理工作日趋繁重,各种来源的数据产生各种层出不穷的问题,严重影响城市规划时的准确性,为此全面合理的掌握好各方面的城市规划资料才能做出更加科学的决策.移动端的兴起为规 ...
- 使用DataOutputStream写入int类型数字不能显示
前段时间做Android系统项目需要使用DataOutputStream数据流向文件里写入数据,写入的有String类型和int类型.写入之后在代码中使用DataInputStream读出是没有问题的 ...
- <转>技术团队新官上任之基层篇
发表于2013-09-04 17:17| 10455次阅读| 来源<程序员>| 35 条评论| 作者高博 <程序员>杂志2013年9月刊技术团队管理EMC高博CTO 摘要:从技 ...
- Django-数据模型
修改model.py文件 from django.db import models # Create your models here. class Question(models.Model): q ...
- android中布局文件中 layout_weight 的属性详解
在不同的情况下,layout_weight属性作用是不同的.主要有两种属性: 1.当布局中的控件的尺寸(宽和高)都有指定时,它所表示的该控件在父容器中的比重,及它在父容器中所占的比例,数值越大,比重越 ...
- 一个用shell写的统计目录下统计文件行数的代码
此代码是用来回忆当初学的shell脚本,很多知识忘了,写这个花了我三个小时的时间 #!/bin/ksh #count *.c file the num of lineg_csum=0g_hsum=0 ...