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 ...
随机推荐
- WINDOWS记事本的换行\r\n
今天发现,\r\n才能换行,好像记事本不能改.
- java类的访问修饰符
1.java中外部类的访问修饰符有如下四种: public,默认,abstract,final // public,默认,abstract,final. public class Test1 {} c ...
- diverta 2019 Programming Contest
A:签到. #include<bits/stdc++.h> using namespace std; #define ll long long #define inf 1000000010 ...
- 音视频入门-03-RGB转成BMP图片
* 音视频入门文章目录 * BMP 文件格式解析 BMP 文件由文件头.位图信息头.颜色信息和图形数据四部分组成. 位图文件头(14个字节) 位图信息头(40个字节) 颜色信息 图形数据 文件头与信息 ...
- (四)springmvc之获取servlet原生对象
一.使用DI注入的方式 <a href="<%=request.getContextPath()%>/servletObj_1">DI注入的方式</a ...
- Q-Dir
Q-dir,可以分界面,分文件夹,快捷选择等优势,非常好用的工具,可以替代微软的File Explorer. 官网:https://www.softwareok.com/?seite=Freeware ...
- Python练习_数据类型_day4
题目 1.作业 1,写代码,有如下列表,按照要求实现每一个功能 li = ["alex", "WuSir", "ritian", " ...
- Hackthebox--------irked
菜鸟一枚,大佬轻喷!! Web页面就一张表情图和一句IRC is almost working!(是irc服务么??!!) 查看图片信息,貌似图片没这么简单.... 果然没这么简单,不行,得想办法得到 ...
- JavaScript--常用对象的属性及方法(2)
Array对象(数组) 数组最常用属性:length 获取数组的元素个数 方法: toString() 将数组转换为字符串 var arr = ["武汉市","成都市&q ...
- jQuery动画速成
引入下面css中样式,然后在需要使用的元素中类上添加相应的效果就可以了 例如 animated固定要添加的类,不然会没有效果,bounceIn是你想要的动画效果,fight是你自己定义的类名,可以写样 ...