@fabalous/runtime-node
Advanced tools
Comparing version 0.0.47 to 0.0.48
@@ -17,3 +17,4 @@ import FabaCore from "@fabalous/core/FabaCore"; | ||
*/ | ||
constructor(store: FabaStore<any>, port: number, sessionSecret?: string); | ||
constructor(store: FabaStore<any>, port: number, sessionSecret?: string, dbSession?: boolean); | ||
private initSession(sessionSecret); | ||
/** | ||
@@ -20,0 +21,0 @@ * TODO: Reafactor or delete this? |
@@ -20,7 +20,18 @@ import * as tslib_1 from "tslib"; | ||
*/ | ||
function FabaRuntimeNode(store, port, sessionSecret) { | ||
function FabaRuntimeNode(store, port, sessionSecret, dbSession) { | ||
if (sessionSecret === void 0) { sessionSecret = "sessionFabalous"; } | ||
if (dbSession === void 0) { dbSession = false; } | ||
var _this = _super.call(this, store) || this; | ||
_this.express = require('express'); | ||
require('source-map-support').install(); | ||
//console.log('\x1Bc'); | ||
_this.app = _this.express(); | ||
// this.app.use(helmet({})); | ||
if (dbSession) { | ||
_this.initSession(sessionSecret); | ||
} | ||
_this.startServer(port); | ||
return _this; | ||
} | ||
FabaRuntimeNode.prototype.initSession = function (sessionSecret) { | ||
var sessionStore = new MongoDBStore({ | ||
@@ -30,7 +41,4 @@ uri: 'mongodb://localhost:27017/connect_mongodb_session_test', | ||
}); | ||
require('source-map-support').install(); | ||
_this.app = _this.express(); | ||
// this.app.use(helmet({})); | ||
if (process.env.NODE_ENV == "development") { | ||
_this.app.use(session({ | ||
this.app.use(session({ | ||
secret: sessionSecret, | ||
@@ -44,3 +52,3 @@ resave: false, | ||
else { | ||
_this.app.use(session({ | ||
this.app.use(session({ | ||
secret: sessionSecret, | ||
@@ -53,5 +61,3 @@ resave: false, | ||
} | ||
_this.startServer(port); | ||
return _this; | ||
} | ||
}; | ||
/** | ||
@@ -58,0 +64,0 @@ * TODO: Reafactor or delete this? |
{ | ||
"name": "@fabalous/runtime-node", | ||
"version": "0.0.47", | ||
"version": "0.0.48", | ||
"description": "Fabalous Node runtime", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22247
445