backend-plus 2.5.2-betha.16 → 2.5.2-betha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/backend-plus.d.ts +2 -1
- package/lib/backend-plus.js +3 -1
- package/package.json +1 -1
package/lib/backend-plus.d.ts
CHANGED
|
@@ -396,7 +396,8 @@ export interface AppConfigServer
|
|
|
396
396
|
"kill-9": string // a way to kill from URL with a token
|
|
397
397
|
bitacoraSchema: string
|
|
398
398
|
bitacoraTableName: string
|
|
399
|
-
|
|
399
|
+
useCors: boolean //habilita Cross-Origin Resource Sharing
|
|
400
|
+
allowedHosts:string[] //determina API allowed hosts (necesita habilitar useCors)
|
|
400
401
|
}
|
|
401
402
|
export interface AppConfigDb
|
|
402
403
|
{
|
package/lib/backend-plus.js
CHANGED
|
@@ -924,7 +924,9 @@ AppBackend.prototype.start = function start(opts){
|
|
|
924
924
|
},
|
|
925
925
|
credentials: true
|
|
926
926
|
};
|
|
927
|
-
|
|
927
|
+
if(be.config.server.useCors){
|
|
928
|
+
mainApp.use(cors(corsOptions));
|
|
929
|
+
}
|
|
928
930
|
mainApp.use(bodyParser.urlencoded({extended:true, limit: '50mb'}));
|
|
929
931
|
mainApp.use(function(req,res,next){
|
|
930
932
|
if((req.headers['content-type']||'').match(/^multipart\/form-data/)){
|
package/package.json
CHANGED