Fix linter

This commit is contained in:
Jake Howard 2017-04-18 13:52:56 +01:00
parent eb3a2553ba
commit a54d3528a8
5 changed files with 23 additions and 20 deletions

View file

@ -1,5 +1,5 @@
import * as staticFile from 'connect-static-file';
import { Request, Response } from 'express';
import * as staticFile from 'connect-static-file'
import * as path from 'path';
export default function handle404(serveDir: string) {
@ -7,5 +7,5 @@ export default function handle404(serveDir : string) {
return function (request: Request, response: Response, next: Function) {
response.statusCode = 404;
return handle404Middleware(request, response, next);
}
};
}

View file

@ -2,7 +2,8 @@ import * as basicAuth from 'express-basic-auth';
export default function basicAuthHandler(username: string, password: string) {
return basicAuth({
authorizer: (req_username : string, req_password : string) => req_username === username && req_password === password,
authorizer:
(reqUsername: string, reqPassword: string) => reqUsername === username && reqPassword === password,
challenge: true
});
}

View file

@ -1,17 +1,17 @@
import * as winston from 'winston';
import * as expressWinston from 'express-winston';
import * as winston from 'winston';
export default expressWinston.logger({
transports: [
new winston.transports.Console({
colorize: true
})
],
colorize: true,
meta: false,
msg: '{{ req.url }} '
.concat('status:{{ res.statusCode }} ')
.concat('useragent:{{ req.headers["user-agent"] }} ')
.concat('time:{{ res.responseTime }}ms'),
colorize: true,
statusLevels: true
statusLevels: true,
transports: [
new winston.transports.Console({
colorize: true
})
],
});

View file

@ -1,6 +1,6 @@
import * as express from 'express';
import * as serveIndex from 'serve-index';
import * as path from 'path';
import * as serveIndex from 'serve-index';
function isDirectory(url: string): boolean {
return /\/$/.test(url);

View file

@ -2,6 +2,8 @@
"extends": "tslint:recommended",
"rules": {
"quotemark": [true, "single"],
"trailing-comma": [false]
"trailing-comma": false,
"only-arrow-functions": false,
"interface-name": false
}
}