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 ...
随机推荐
- python标准库之collections介绍
collections----容器数据类型 collections模块包含了除list.dict.和tuple之外的容器数据类型,如counter.defaultdict.deque.namedtup ...
- char. 类型篇
对于强类型的c语言,类型贯穿着整个语言体系,掌握好类型,学c语言就相当上手 .. 计算机的内存被分成一个个的储存单元. 一个储存单元=1 byte=8 bit 对于基本整型类型.char = ...
- Redis慢日志取出来
http://blog.chinaunix.net/uid-31396856-id-5758295.htmlhttps://blog.51cto.com/legehappy/2151986?sourc ...
- Spring (4)框架
Spring第四天讲义 今日内容 Spring的事务管理 Spring和MyBatis框架的集成 1. Spring的事务管理 1.1. 事务是什么? 在操作数据库时(增删改),如果同时操作多次数据, ...
- Linux yum安装java环境
1.jdk 1.8 #系统版本 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) #安装 ...
- Intellij IDEA集成JProfiler性能分析神器
环境 JProfiler 17.1.3(IDEA插件) JProfiler 9.2(可执行软件) IntelliJ IDEA 2017.2.5 下载 下载JProfiler(IDEA)插件 方式1: ...
- javascript 正则表达式的简单操作
前言:这是笔者学习之后自己的理解与整理.如果有错误或者疑问的地方,请大家指正,我会持续更新! RegExp 正则表达式是描述字符模式的对象. 正则表达式用于对字符串模式匹配及检索替换,是对字符串执行模 ...
- 音视频入门-03-RGB转成BMP图片
* 音视频入门文章目录 * BMP 文件格式解析 BMP 文件由文件头.位图信息头.颜色信息和图形数据四部分组成. 位图文件头(14个字节) 位图信息头(40个字节) 颜色信息 图形数据 文件头与信息 ...
- POJ1484(Blowing Fuses)--简单模拟
题目链接:http://poj.org/problem?id=1484 这题直接简单模拟即可.给你n个容器,m个操作,最大容量C.模拟每一个对器件的开关操作.如果原来是关闭的,则打开,同时最大功耗加上 ...
- Css制作table细线表格
制作细线表格,我想应该是最基本的css知识了,记录下来巩固下. 推荐: table{ border-collapse:collapse; border: 1px solid #000000; } td ...