Fix linter
This commit is contained in:
parent
eb3a2553ba
commit
a54d3528a8
5 changed files with 23 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
||||||
|
import * as staticFile from 'connect-static-file';
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import * as staticFile from 'connect-static-file'
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export default function handle404(serveDir: string) {
|
export default function handle404(serveDir: string) {
|
||||||
|
@ -7,5 +7,5 @@ export default function handle404(serveDir : string) {
|
||||||
return function (request: Request, response: Response, next: Function) {
|
return function (request: Request, response: Response, next: Function) {
|
||||||
response.statusCode = 404;
|
response.statusCode = 404;
|
||||||
return handle404Middleware(request, response, next);
|
return handle404Middleware(request, response, next);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,8 @@ import * as basicAuth from 'express-basic-auth';
|
||||||
|
|
||||||
export default function basicAuthHandler(username: string, password: string) {
|
export default function basicAuthHandler(username: string, password: string) {
|
||||||
return basicAuth({
|
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
|
challenge: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import * as winston from 'winston';
|
|
||||||
import * as expressWinston from 'express-winston';
|
import * as expressWinston from 'express-winston';
|
||||||
|
import * as winston from 'winston';
|
||||||
|
|
||||||
export default expressWinston.logger({
|
export default expressWinston.logger({
|
||||||
transports: [
|
colorize: true,
|
||||||
new winston.transports.Console({
|
|
||||||
colorize: true
|
|
||||||
})
|
|
||||||
],
|
|
||||||
meta: false,
|
meta: false,
|
||||||
msg: '{{ req.url }} '
|
msg: '{{ req.url }} '
|
||||||
.concat('status:{{ res.statusCode }} ')
|
.concat('status:{{ res.statusCode }} ')
|
||||||
.concat('useragent:{{ req.headers["user-agent"] }} ')
|
.concat('useragent:{{ req.headers["user-agent"] }} ')
|
||||||
.concat('time:{{ res.responseTime }}ms'),
|
.concat('time:{{ res.responseTime }}ms'),
|
||||||
colorize: true,
|
statusLevels: true,
|
||||||
statusLevels: true
|
transports: [
|
||||||
|
new winston.transports.Console({
|
||||||
|
colorize: true
|
||||||
|
})
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as express from 'express';
|
import * as express from 'express';
|
||||||
import * as serveIndex from 'serve-index';
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
import * as serveIndex from 'serve-index';
|
||||||
|
|
||||||
function isDirectory(url: string): boolean {
|
function isDirectory(url: string): boolean {
|
||||||
return /\/$/.test(url);
|
return /\/$/.test(url);
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
"extends": "tslint:recommended",
|
"extends": "tslint:recommended",
|
||||||
"rules": {
|
"rules": {
|
||||||
"quotemark": [true, "single"],
|
"quotemark": [true, "single"],
|
||||||
"trailing-comma": [false]
|
"trailing-comma": false,
|
||||||
|
"only-arrow-functions": false,
|
||||||
|
"interface-name": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue