@@ -9,6 +9,7 @@ import * as cookieParser from "cookie-parser";
99import * as cookieSession from "cookie-session" ;
1010import * as crypto from "crypto" ;
1111import * as flash from "flash" ;
12+ import * as morgan from "morgan" ;
1213
1314import * as samlp from "samlp" ;
1415import { SamlProvider } from "./SamlProvider" ;
@@ -24,6 +25,7 @@ export class WebServer {
2425 this . _logger = logger ;
2526
2627 this . app = express ( ) ;
28+ this . app . use ( morgan ( 'combined' , { stream : ( winston . stream as any ) . write } ) ) ;
2729 this . app . use ( compression ( ) ) ;
2830 this . app . use ( bodyParser . urlencoded ( { extended : true } ) ) ;
2931 this . app . use ( bodyParser . json ( ) ) ;
@@ -85,13 +87,17 @@ export class WebServer {
8587 }
8688 server = https . createServer ( options , this . app ) ;
8789
88- var redirapp = express ( ) ;
89- var _http = http . createServer ( redirapp ) ;
90- redirapp . get ( '*' , function ( req , res ) {
91- //res.redirect('https://' + req.headers.host + req.url);
92- res . status ( 200 ) . json ( { status : "ok" } ) ;
93- } )
90+
91+ var _http = http . createServer ( this . app ) ;
9492 _http . listen ( 80 ) ;
93+
94+ // var redirapp = express();
95+ // var _http = http.createServer(redirapp);
96+ // redirapp.get('*', function (req, res) {
97+ // //res.redirect('https://' + req.headers.host + req.url);
98+ // res.status(200).json({ status: "ok" });
99+ // })
100+ // _http.listen(80);
95101 } else {
96102 server = http . createServer ( this . app ) ;
97103 }
0 commit comments