cc-core-cli 1.0.108 → 1.0.110
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/package.json
CHANGED
|
@@ -96,7 +96,10 @@ if (+process.env.MONGODB_MAX_POOL_SIZE) {
|
|
|
96
96
|
permissions: _.get(req, "permissions", []),
|
|
97
97
|
headers: _.get(req, "headers", {}),
|
|
98
98
|
ip: _.get(req, "ip"),
|
|
99
|
+
protocol: _.get(req, "protocol"),
|
|
99
100
|
hostname: _.get(req, "hostname"),
|
|
101
|
+
url: _.get(req, "url"),
|
|
102
|
+
method: _.get(req, "method"),
|
|
100
103
|
body: _.get(req, "body", {}),
|
|
101
104
|
action_profile: _.get(req, "action_profile", {}),
|
|
102
105
|
permisson_entities: _.get(req, "permisson_entities", {}),
|
|
@@ -118,7 +121,10 @@ if (+process.env.MONGODB_MAX_POOL_SIZE) {
|
|
|
118
121
|
ip:
|
|
119
122
|
_.get(req, "socket.remoteAddress") ||
|
|
120
123
|
_.get(req, "connection.remoteAddress"),
|
|
121
|
-
|
|
124
|
+
protocol: _.get(req, "protocol"),
|
|
125
|
+
hostname: _.get(req, "hostname"),
|
|
126
|
+
url: _.get(req, "url"),
|
|
127
|
+
method: _.get(req, "method"),
|
|
122
128
|
body: _.get(req, "body", {}),
|
|
123
129
|
action_profile: _.get(req, "action_profile", {}),
|
|
124
130
|
permisson_entities: _.get(req, "permisson_entities", {}),
|
|
@@ -221,25 +221,11 @@ async function initial(app: NestFastifyApplication) {
|
|
|
221
221
|
|
|
222
222
|
async function bootstrap() {
|
|
223
223
|
dotenv.config();
|
|
224
|
-
// const whitelist = _.concat(["0.0.0.0", "127.0.0.1"], [`${process.env.LOOP_BACK_IP}`]);
|
|
225
224
|
const fastify = new FastifyAdapter({ logger: true, bodyLimit: 104857600 });
|
|
226
|
-
|
|
227
|
-
// whitelist,
|
|
228
|
-
// timeWindow: 15 * 60 * 1000, // 15 minutes
|
|
229
|
-
// max: 100 // limit each IP to 100 requests per windowMs
|
|
230
|
-
// });
|
|
225
|
+
|
|
231
226
|
fastify.register(require("@fastify/cors"), {
|
|
232
227
|
// put your options here
|
|
233
228
|
});
|
|
234
|
-
fastify.register(require("fastify-xml-body-parser"));
|
|
235
|
-
|
|
236
|
-
// fastify.register(require("fastify-raw-body"), {
|
|
237
|
-
// field: 'rawBody', // change the default request.rawBody property name
|
|
238
|
-
// global: false, // add the rawBody to every request. **Default true**
|
|
239
|
-
// encoding: 'utf8', // set it to false to set rawBody as a Buffer **Default utf8**
|
|
240
|
-
// runFirst: true, // get the body before any preParsing hook change/uncompress it. **Default false**
|
|
241
|
-
// routes: [] // array of routes, **`global`** will be ignored, wildcard routes not supported
|
|
242
|
-
// });
|
|
243
229
|
|
|
244
230
|
fastify.register(rTracer.fastifyPlugin, {
|
|
245
231
|
requestIdFactory: req => ({
|
|
@@ -248,7 +234,13 @@ async function bootstrap() {
|
|
|
248
234
|
user_agent: req.headers["user-agent"]
|
|
249
235
|
})
|
|
250
236
|
});
|
|
237
|
+
|
|
238
|
+
// Register the multipart plugin
|
|
239
|
+
fastify.register(require("@fastify/multipart"), { attachFieldsToBody: true });
|
|
251
240
|
|
|
241
|
+
// Register the fastify-xml-body-parser plugin
|
|
242
|
+
fastify.register(require("fastify-xml-body-parser"));
|
|
243
|
+
|
|
252
244
|
const app = await NestFactory.create<NestFastifyApplication>(
|
|
253
245
|
AppModule,
|
|
254
246
|
fastify
|