上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 68 下一页
今天来学学Grunt~~目的是为了自动化!自动压缩...自动修复...自动合并等...提示:Grunt基于Node.js,安装之前要先安装Node.js1.安装 grunt-clinpm install -g grunt-cli2.在项目目录下,用以下命令创建一个基本的package.json文件n... Read More
posted @ 2015-11-11 19:34 tinyphp Views(382) Comments(0) Diggs(0)
右击菜单栏,选择“快速编辑模式”复制:选择文本后按回车,然后就可以去其他地方粘贴了粘贴:右击鼠标就可以粘贴内容简单到都不好意思发布出来了。。。。 Read More
posted @ 2015-11-11 18:33 tinyphp Views(338) Comments(0) Diggs(0)
express获取参数有三种方法:req.query适合 http://localhost:3000/form?num=8888req.body 适合http://localhost:3000/form,然后Post一个num为tinyphpreq.params适合获取form后的num:http:... Read More
posted @ 2015-11-09 18:44 tinyphp Views(5062) Comments(0) Diggs(1)
nodejs// 访问http://localhost:3000/home?id=001&name=tomvar http = require('http');var url = require('url');http.createServer(function(req, res) { var... Read More
posted @ 2015-11-07 21:46 tinyphp Views(402) Comments(0) Diggs(0)
如果在nodejs下npm install moment引用模块:var moment = require('moment');用法:当前时间:2015-11-07 18:00:51moment().format('YYYY-MM-DD HH:mm:ss');今天是星期几:6moment().for... Read More
posted @ 2015-11-07 18:10 tinyphp Views(730) Comments(0) Diggs(0)
...//index pagevar items=[{title:"文章1"},{title:"文章2"}];app.get('/',function(req,res){ res.render('index',{title:'电影首页',items:items});});...对应ejsmy ej... Read More
posted @ 2015-11-06 11:34 tinyphp Views(10017) Comments(0) Diggs(0)
原app.jsvar express = require('express');var app = express(); /*start*/app.get('/',function(req,res){ res.send('home');});app.get('/admin',function(... Read More
posted @ 2015-11-05 17:11 tinyphp Views(969) Comments(0) Diggs(0)
var express = require('express');var app = express(); app.get('/',function(req,res){res.redirect('/admin');});app.get('/admin',function(req,res){ r... Read More
posted @ 2015-11-05 16:36 tinyphp Views(612) Comments(0) Diggs(0)
Express里有个中间件(middleware)的概念。所谓中间件,即在数据正式发给用户之前,对数据进行处理。function (req, res, next)第一个参数是Request对象req。第二个参数是Response对象res。第三个则是用来驱动中间件调用链的函数next,如果你想让后面... Read More
posted @ 2015-11-05 15:51 tinyphp Views(331) Comments(0) Diggs(0)
使用 app.route() 创建路由路径的链式路由句柄。由于路径在一个地方指定,这样做有助于创建模块化的路由,而且减少了代码冗余和拼写错误。先放小实例:app.jsvar express = require('express');var app = express(); var bird =req... Read More
posted @ 2015-11-05 14:47 tinyphp Views(1423) Comments(0) Diggs(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 68 下一页