@fusengine/berserk-engine
Advanced tools
Comparing version 1.0.1 to 1.0.2
module.exports = { | ||
PORT: '', | ||
port: '', | ||
/** Define Header Request */ | ||
header: { | ||
origine: '*', | ||
headers: 'Origin, X-Requested-With, Content-Type, Accept, token-berserk', | ||
method: 'PUT, POST, GET, DELETE, OPTIONS', | ||
credentials: true, | ||
}, | ||
} |
@@ -8,7 +8,7 @@ /*! | ||
// const path = require('path') | ||
// const pathBerserk = path.resolve(__dirname, 'config.js') | ||
const path = require('path') | ||
const pathBerserk = path.resolve(__dirname, 'config.js') | ||
module.exports = { | ||
engine: require('./lib'), | ||
engine: require('./lib')(pathBerserk), | ||
} |
module.exports = { | ||
/** Port file */ | ||
Port: require('./Port'), | ||
Header: require('./Header'), | ||
} |
const colors = require('colors') | ||
const logSymbols = require('log-symbols') | ||
module.exports = berserkEngine = pathPort => { | ||
/** Express Module */ | ||
const { Port, Header } = require('./express') | ||
/** | ||
* berserkEngine | ||
* @param {String} configPath link to config if you want custom your configuration | ||
*/ | ||
const berserkEngine = configPath => { | ||
console.log(colors.blue.bold(`${logSymbols.success} Express: Loaded`)) | ||
if (pathPort) { | ||
const { PORT } = require(`${pathPort}`) | ||
if (PORT) { | ||
require('./express/index').Port(PORT) | ||
} else { | ||
require('./express/index').Port() | ||
} | ||
if (configPath) { | ||
/** got read file to config path */ | ||
const { port, header } = require(`${configPath}`) | ||
/** view array header config */ | ||
if (header) headerObj = Object.values(header) | ||
/** Header Request*/ | ||
header ? Header(...headerObj) : Header() | ||
/** Port App*/ | ||
port ? Port(port) : Port() | ||
} else { | ||
require('./express/index').Port() | ||
Header() | ||
Port() | ||
} | ||
} | ||
module.exports = berserkEngine |
@@ -18,2 +18,16 @@ /** | ||
portFunction: value => process.env.PORT || value, | ||
/** | ||
* header express | ||
* @param {String} origine origine request | ||
* @param {String} headers header request | ||
* @param {String} method method to put post get delete options | ||
* @param {Boolean} credentials true and false | ||
*/ | ||
header: { | ||
origine: '*', | ||
headers: 'Origin, X-Requested-With, Content-Type, Accept, token', | ||
method: 'PUT, POST, GET, DELETE, OPTIONS', | ||
credentials: true, | ||
}, | ||
} |
{ | ||
"name": "@fusengine/berserk-engine", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Berserk engine run start application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,3 +0,3 @@ | ||
![alt Berserk](./logo.png "Berserk Engine") | ||
![alt Berserk](https://cdn.fusengine.ch/logo/berserk.png "Berserk Engine") | ||
Berserk-engine use [express](https://github.com/expressjs/express) to create simple framework. |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
171
5409