learning express step(四)
learning express route function
const express = require('express');
const app = express();
app.get('/', function (req, res) {
res.send('root');
});
app.get('/about', function (req, res) {
res.send('about');
});
app.get('/random.txt',function (req, res) {
res.send('random.txt');
});
// abc abd
app.get('/ab?cd',function (req, res) {
res.send('ab?cd');
});
// abbcd abbbcd and so on
app.get('/ab+cd', function (req, res) {
res.send('ab+cd');
});
// adRANDOMcd
app.get('/ab*cd', function (req, res) {
res.send('ab*cd');
});
//. ade adcde
app.get('/ab(cd)?e', function (req, res) {
res.send("ab(cd)?e");
});
app.listen(,function () {
console.log("learning express router");
});
learning express step(四)的更多相关文章
- learning express step(十四)
learning express error handle code: const express = require('express'); const app = express(); const ...
- learning express step(十三)
learning express error handle code: const express = require('express'); const app = express(); app.g ...
- learning express step(十二)
learning express view engine function const express = require('express'); const app = express(); app ...
- learning express step(十一)
learning express.Router() code: const express = require('express'); const app = express(); var route ...
- learning express step(五)
learning express middleware var express = require('express'); var app = express(); var myLogger = ...
- learning express step(九)
router-level middleware works in the same way as application-level middleware, except it is bound to ...
- learning express step(八)
To skip the rest of the middleware functions from a router middleware stack, call next('route') to p ...
- learning express step(七)
Route handlers enable you to define multiple routes for a path. The example below defines two routes ...
- learning express step(六)
code: use application middleware var express = require('express'); var app = express(); app.use(func ...
随机推荐
- C++ 中不能声明为虚函数的函数有哪些?
目录 普通函数 构造函数 内联成员函数 静态成员函数 友元函数 普通函数 普通函数(非成员函数)只能被overload,不能被override,而且编译器会在编译时绑定函数. 多态的运行期行为体现在虚 ...
- SAS学习笔记12 SAS数据清洗和加工
set语句纵向合并 我们把a1和b1进行合并,并区分是来自哪个数据集,会用到in=选项 in=a是产生临时变量a,由于它是a1的选项,所以a的值=1(来自a1)或者=0(不来自a1) in=b是产生临 ...
- jira索引失败
""" # 参考:http://www.mamicode.com/info-detail-2369087.html jira断电重启后索引失败, 解决方法: 关闭jira ...
- [Vue]vue-router嵌套路由(子路由)
总共添加两个子路由,分别命名Collection.vue(我的收藏)和Trace.vue(我的足迹) 1.重构router/index.js的路由配置,需要使用children数组来定义子路由,具体如 ...
- CAN总线上的消息单帧某个信号的值计算(C#)
public static ulong GetMotorolaSignalValue(byte[] data, int startBit, int bitLength) { ; , j =; i ...
- RESTful接口开发
package com.aaaaaa.manager.controller; import org.springframework.beans.factory.annotation.Autowired ...
- Java Web 深入分析(4) Java IO 深入分析
I/O问题可以说是现在海量数据时代下 ,I/O大部分web系统的瓶颈.我们要了解的java I/O(后面简称为(IO)) IO类库的基本结构 磁盘IO的工作机制 网络IO的工作机制 NIO的工作方式 ...
- sql计算两个时间之间的差,并用时分秒表示
这是自己写的方法,总觉得会有更好的办法实现这个效果呢? SELECT then ))))+'秒' then )))+'秒' then ))+'秒' else CONVERT(nvarchar,DATE ...
- impdp时报错ORA-39083&ORA-01917
转自:http://www.codes51.com/article/detail_146662.html impdp时报错ORA-39083&ORA-01917ORA-39083: 对象类型 ...
- Sqlmap对dvwa进行sql注入测试
前提准备条件: 1.下载安装dvwa,下载链接地址:http://www.dvwa.co.uk/.2.需要安装python运行环境.3.下载sqlmap包并将其解压. 一.查看所有的数据库;(其中db ...