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 ...
随机推荐
- 一文搞懂嵌入式uboot、kernel、文件系统的关系
总览: 在linux系统软件架构可以分为4个层次(从低到高分别为): 1.引导加载程序 引导加载程序(Bootloader)是固化在硬件Flash中的一段引导代码,用于完成硬件的一 ...
- msyql 去重
delete from userinfo where busi_id in (select busi_id from (select busi_id from userinfo group by bu ...
- ajax回调函数,全局变量赋值后,ajax外无法获取的解决
1 ajax回调函数内,function的执行与ajax外是异步的,常导致全局变量赋值后,再次使用此变量人无法获取. 所以,可以把需要的步骤,独立放在functuon中,在ajax回调函数中执行.可较 ...
- AtCoder Grand Contest 040 B - Two Contests
传送门 一看就感觉很贪心 考虑左端点最右的区间 $p$ 和右端点最左的区间 $q$ 如果 $p,q$ 属于同一个集合(设为 $S$,另一个集合设为 $T$),那么其他的区间不管是不是在 $S$ 都不会 ...
- Visual Studio 2017修改编码UTF-8
转载自:https://blog.csdn.net/qq_36848370/article/details/82597157 VS 2017隐藏了高级保存功能,导致没办法直接去设置代码编码 UTF-8 ...
- qt连接oracle数据库
由与qt开源版本没有提供oracle数据库驱动,需要自己根据源代码来手动编译oracle驱动. 经过近三天的折腾,终于成功编译oracle驱动,连接到数据库 ps:期间经过各种失败疼苦迷茫.现在终于完 ...
- IDEA安装及默认配置习惯配置(一)
最新新转战IDEA,每次安装完需要做一些操作习惯的设置,在这里记录一下,下次安装可以快速上手用. 第一步,JAVA安装 JDK官方下载地址:https://www.oracle.com 下载JDK时根 ...
- win8怎么强制删除文件
转自:https://www.jizhuba.com/zhichanglicai/20180119/5705.html 方法/步骤1.例如我们想删除桌面上的“123”文件夹,发现无法删除.2.可以这样 ...
- vue中用div的contenteditable属性实现v-for遍历,双向数据绑定的动态表格编辑
1.HTML部分 <tr v-for="(item,index) in customerVisitList2" :key="index"> < ...
- CA、证书及openssl用法
CA和证书 摘要:涉及到网络安全这一块,想必大家都听过CA吧.像百度.淘宝.京东等这些知名网站,每年都要花费一笔money来买CA证书.但其实简单的企业内的CA认证,我们自己就可以实现,今天我就讲解一 ...