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(四)的更多相关文章

  1. learning express step(十四)

    learning express error handle code: const express = require('express'); const app = express(); const ...

  2. learning express step(十三)

    learning express error handle code: const express = require('express'); const app = express(); app.g ...

  3. learning express step(十二)

    learning express view engine function const express = require('express'); const app = express(); app ...

  4. learning express step(十一)

    learning express.Router() code: const express = require('express'); const app = express(); var route ...

  5. learning express step(五)

    learning  express  middleware var express = require('express'); var app = express(); var myLogger = ...

  6. learning express step(九)

    router-level middleware works in the same way as application-level middleware, except it is bound to ...

  7. learning express step(八)

    To skip the rest of the middleware functions from a router middleware stack, call next('route') to p ...

  8. learning express step(七)

    Route handlers enable you to define multiple routes for a path. The example below defines two routes ...

  9. learning express step(六)

    code: use application middleware var express = require('express'); var app = express(); app.use(func ...

随机推荐

  1. TCP三次握手和四次挥手及wireshark抓取

    TCP的三次握手与四次挥手的详细介绍: 三次握手: 第一次握手(SYN=1, seq=x): 客户端发送客户端发送一个 TCP 的 SYN 标志位置1的,指明客户端打算连接的服务器的端口,以及初始序号 ...

  2. PHP7有没有你们说的那么牛逼

    男人不能快,但程序一定要快.PHP7到底快不快,我们拭目以待. PHP7来一发 PHP7正式发布到现在已经一年半了,刚出道就号称比旧版本快了几倍,各种开源框架或系统运行在PHP7上速度效率提高了几倍, ...

  3. element-ui获取用户选中项

    <el-table :data="tableData" stripe border style="width: 100%" @selection-chan ...

  4. harbor上传镜像

    在harbor服务器 1. 下载测试上传使用的镜像docker pull hello-world2. 打tagdocker tag docker.io/hello-world:latest 172.1 ...

  5. RMAN执行crosscheck archive报错ORA-19633问题处理

    一.问题现象 RMAN connect target /; run { crosscheck archivelog all; } ORA-: control file record is out of ...

  6. poj 2915

    #include <iostream> #include <algorithm> #include <cstdio> #include <cmath> ...

  7. MySQL存储的字段是不区分大小写的,你知道吗?

    做一个积极的人 编码.改bug.提升自己 我有一个乐园,面向编程,春暖花开! 00 简单回顾 之前写过一篇关于mysql 对表大小写敏感的问题,其实在mysql中字段存储的内容是不区分大小写的,本篇进 ...

  8. 在docker下SQL Server attach mdf和ldf文件

    (DB:MyPost) USE masterGO-- Create database via attachCREATE DATABASE [MyPost]    ON ( FILENAME = N'C ...

  9. Html 中scroll offset client 总结

    HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth scrollHeight: 获取对象的滚动高度. scrollLeft:设置或获取位于对 ...

  10. cli中webpack的配置详解

    一.前言 vue-cli是构建vue单页应用的脚手架,输入一串指定的命令行从而自动生成vue.js+wepack的项目模板.这其中webpack发挥了很大的作用,它使得我们的代码模块化,引入一些插件帮 ...