Upgrade dependencies
This commit is contained in:
parent
53c6c977a8
commit
3e7f956bf6
3 changed files with 23 additions and 24 deletions
43
package.json
43
package.json
|
@ -27,30 +27,29 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/RealOrangeOne/tstatic#readme",
|
"homepage": "https://github.com/RealOrangeOne/tstatic#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"basic-auth": "=1.1.0",
|
"compression": "1.6.2",
|
||||||
"compression": "=1.6.2",
|
"connect-static-file": "1.2.0",
|
||||||
"connect-static-file": "=1.1.2",
|
"docopt": "0.6.2",
|
||||||
"docopt": "=0.6.2",
|
"express": "4.15.3",
|
||||||
"express": "=4.15.2",
|
|
||||||
"express-basic-auth": "1.0.1",
|
"express-basic-auth": "1.0.1",
|
||||||
"express-ip-access-control": "=1.0.5",
|
"express-ip-access-control": "1.0.5",
|
||||||
"express-winston": "=2.3.0",
|
"express-winston": "2.4.0",
|
||||||
"helmet": "=3.6.1",
|
"helmet": "3.6.1",
|
||||||
"opbeat": "=4.12.0",
|
"opbeat": "4.14.0",
|
||||||
"open": "=0.0.5",
|
"open": "0.0.5",
|
||||||
"serve-index": "=1.8.0",
|
"serve-index": "1.9.0",
|
||||||
"winston": "=2.3.1"
|
"winston": "2.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "=3.5.0",
|
"chai": "4.0.2",
|
||||||
"chai-as-promised": "=6.0.0",
|
"chai-as-promised": "7.1.1",
|
||||||
"mocha": "=3.2.0",
|
"mocha": "3.4.2",
|
||||||
"node-fetch": "=1.6.3",
|
"node-fetch": "1.7.1",
|
||||||
"nsp": "=2.6.3",
|
"nsp": "2.6.3",
|
||||||
"supertest": "=3.0.0",
|
"supertest": "3.0.0",
|
||||||
"ts-node": "=2.1.0",
|
"ts-node": "3.2.0",
|
||||||
"tslint": "=4.5.1",
|
"tslint": "5.5.0",
|
||||||
"typescript": "=2.2.1",
|
"typescript": "2.2.1",
|
||||||
"typings": "=2.1.0"
|
"typings": "2.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import * as path from 'path';
|
||||||
|
|
||||||
export default function handle404(serveDir: string) {
|
export default function handle404(serveDir: string) {
|
||||||
const handle404Middleware = staticFile(path.join(serveDir, '.404.html'));
|
const handle404Middleware = staticFile(path.join(serveDir, '.404.html'));
|
||||||
return function (request: Request, response: Response, next: Function) {
|
return function(request: Request, response: Response, next: () => void) {
|
||||||
response.statusCode = 404;
|
response.statusCode = 404;
|
||||||
return handle404Middleware(request, response, next);
|
return handle404Middleware(request, response, next);
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ function isDirectory(url: string): boolean {
|
||||||
return /\/$/.test(url);
|
return /\/$/.test(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function indexHandle(request: express.Request, response: express.Response, next: Function) {
|
export function indexHandle(request: express.Request, response: express.Response, next: () => void) {
|
||||||
if (isDirectory(request.url)) {
|
if (isDirectory(request.url)) {
|
||||||
request.url = path.join(request.url, 'index.html');
|
request.url = path.join(request.url, 'index.html');
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue