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. Python之系统编程笔记

    概念 命令行工具. Shell 脚本.  系统管理 系统模块 sys   提供一组功能映射Python运行时的操作系统 os    提供跨平台可移植的操作系统编程接口   os.path 提供文件及目 ...

  2. linux 安装xdebug

    一.安装了 xdebug php -m | grep 'xdebug' 如果没有安装就执行 首先根据 phpinfo() 信息 下载对应的版本,具体看参数: 下载地址:https://xdebug.o ...

  3. ASP.NET Core启动流程

    1. 引言 对于ASP.NET Core应用程序来说,我们要记住非常重要的一点是:其本质上是一个独立的控制台应用,它并不是必需在IIS内部托管且并不需要IIS来启动运行(而这正是ASP.NET Cor ...

  4. php 配置微信公众号

    首先你要在微信公众号官网申请一个公众号,然后登录进去 在网页的左下方找到开发的基本配置 就可以开始配置服务器下面的东西了 点击打开成这个样子的 就是一些参数,url填写你自己服务器的具体地址就好了,我 ...

  5. ndk-build 修改输出so位置 (change ndk-build output so lib file path )

    期望的目录结构: Folder --- | --- build.bat | --- Source | --- All sources codes *.cpp *.h | --- Android --- ...

  6. 普通选项卡+自动播放功能+向前/向后按钮 原生js

    今天做了幻灯片,主要功能包括:普通选项卡,向前/向后播放按钮,向前?向后播放功能,自动播放功能 要实现简单选项卡功能是没有问题的,但是添加功能就出现各种各样的问题了 遇到的问题:1 下标问题 2普通选 ...

  7. eclipse调试之edit source lookup path解决方案

    转自:https://blog.csdn.net/zkn_CS_DN_2013/article/details/48731133

  8. JS密码强度检测

    //校验密码强度---沒有匹配到以下級別就提示 function checkPassWord(value){ // 0: 表示第一个级别 1:表示第二个级别 2:表示第三个级别 // 3: 表示第四个 ...

  9. KVM之配置桥接网卡

    配置桥接网卡 添加桥接网卡br0,注释掉已有的eth0配置 [root@ubuntu01 ~]# vi /etc/network/interfaces # This file describes th ...

  10. 利用jenkens+github实现简单的CI/CD

    一  获取github accessToken 依次点击 settings----> Developer settings --->Personal access tokens  到这里如 ...