learning express step(十四)
learning express error handle
code:
const express = require('express');
const app = express();
const fs = require('fs'); app.get('/', function (req, res, next){
fs.readFile('file', function (err, data) {
if(err){
next(err)
}else{
res.send(data);
}
});
}); app.listen();
result:
learning express step(十四)的更多相关文章
- learning express step(十二)
learning express view engine function const express = require('express'); const app = express(); app ...
- learning express step(十)
when develop expree meet some errors, we show how to solve Error: No default engine was specified an ...
- learning express step(四)
learning express route function const express = require('express'); const app = express(); app.get(' ...
- learning express step(十三)
learning express error handle code: const express = require('express'); const app = express(); app.g ...
- 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 = ...
- Deep learning:三十四(用NN实现数据的降维)
数据降维的重要性就不必说了,而用NN(神经网络)来对数据进行大量的降维是从2006开始的,这起源于2006年science上的一篇文章:reducing the dimensionality of d ...
- 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 ...
随机推荐
- asp.net core-2.在vs2017中创建asp.net core应用程序
今天我们用vs2017创建一个asp.net core 的应用程序,打开vs2017 点击:文件—>项目,选择asp.net core web 应用程序 点击确定 红框内就昨天用控制台去创建的应 ...
- POJ2945(Find the Clones)--字典树,map
题意:给你n个规定长度的单词,问你其中出现了1次的单词,出现两次的单词...出现n次单词分别有多少个. 当然这题map也能过,但是这里介绍字典树的做法. 首相对于n个单词存入树中,当然建树过程中遇到一 ...
- 重构与反思-<重构代码的7个阶段>有感
https://coolshell.cn/articles/5201.html/comment-page-2#comment-1932554 过去半年基本上完整经历了这个文章的各个阶段,看完文章结合自 ...
- Oracle数据库默认的data pump dir在哪
转自:https://zhidao.baidu.com/question/921271686131558779.html 使用select * from dba_directories;可以查到,例如 ...
- stm32位带
#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bit ...
- Redis二进制安全概念
二进制安全是指,在传输数据时,保证二进制数据的信息安全,也就是不被篡改.破译等,如果被攻击,能够及时检测出来. 二进制安全包含了密码学的一些东西,比如加解密.签名等. 举个例子,你把数据1111000 ...
- flask自有转换器:int、float、path。默认string
flask自有转换器:int.float.path.默认string # 路由传递的参数默认当做string处理,这里指定int,尖括号中冒号后面的内容是动态的 # -*- coding: utf-8 ...
- 二〇一八-网易秋招面试解析(Java)
一轮面试: Java内存模型讲一下 GC算法,知道的都讲一下 HashMap,get,put实现 JsonWebToken具体实现流程(简历) Spring AOP如何实现,写一个AOP功能的主要流程 ...
- elasticsearch + kibana + x-pack + logstash_集群部署安装
elasticsearch 部分总体描述: 1.elasticsearch 的概念及特点.概念:elasticsearch 是一个基于 lucene 的搜索服务器.lucene 是全文搜索的一个框架. ...
- wakelock查看
Android的wakelock分为两层 待机异常https://wenku.baidu.com/view/6b765c8802020740be1e9bd8.html Linux层和应用层 查看Lin ...