@gustavo-valsechi/node 1.0.17 → 1.0.19

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/dist/index.js CHANGED
@@ -232,13 +232,15 @@ var import_fastify_plugin = __toESM(require("fastify-plugin"));
232
232
  var import_cors = __toESM(require("@fastify/cors"));
233
233
  var app = (0, import_fastify.default)();
234
234
  var serverInit = (appConfig) => {
235
+ var _a;
235
236
  const PORT = process.env.HOST_PORT;
236
237
  const VERSION = process.env.HOST_VERSION;
237
238
  const DOMAIN = process.env.HOST_DOMAIN;
239
+ console.log(process.env);
238
240
  if (!PORT) throw new Error("HOST_PORT is required!");
239
241
  if (!VERSION) throw new Error("HOST_VERSION is required!");
240
242
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
241
- app.register(import_cors.default, { origin: true });
243
+ app.register(import_cors.default, { origin: ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
242
244
  app.register(
243
245
  (0, import_fastify_plugin.default)(async (instance) => {
244
246
  instance.addHook(
package/dist/index.mjs CHANGED
@@ -202,13 +202,15 @@ import fp from "fastify-plugin";
202
202
  import cors from "@fastify/cors";
203
203
  var app = fastify();
204
204
  var serverInit = (appConfig) => {
205
+ var _a;
205
206
  const PORT = process.env.HOST_PORT;
206
207
  const VERSION = process.env.HOST_VERSION;
207
208
  const DOMAIN = process.env.HOST_DOMAIN;
209
+ console.log(process.env);
208
210
  if (!PORT) throw new Error("HOST_PORT is required!");
209
211
  if (!VERSION) throw new Error("HOST_VERSION is required!");
210
212
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
211
- app.register(cors, { origin: true });
213
+ app.register(cors, { origin: ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
212
214
  app.register(
213
215
  fp(async (instance) => {
214
216
  instance.addHook(
@@ -86,13 +86,15 @@ var import_fastify_plugin = __toESM(require("fastify-plugin"));
86
86
  var import_cors = __toESM(require("@fastify/cors"));
87
87
  var app = (0, import_fastify.default)();
88
88
  var serverInit = (appConfig) => {
89
+ var _a;
89
90
  const PORT = process.env.HOST_PORT;
90
91
  const VERSION = process.env.HOST_VERSION;
91
92
  const DOMAIN = process.env.HOST_DOMAIN;
93
+ console.log(process.env);
92
94
  if (!PORT) throw new Error("HOST_PORT is required!");
93
95
  if (!VERSION) throw new Error("HOST_VERSION is required!");
94
96
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
95
- app.register(import_cors.default, { origin: true });
97
+ app.register(import_cors.default, { origin: ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
96
98
  app.register(
97
99
  (0, import_fastify_plugin.default)(async (instance) => {
98
100
  instance.addHook(
@@ -62,13 +62,15 @@ import fp from "fastify-plugin";
62
62
  import cors from "@fastify/cors";
63
63
  var app = fastify();
64
64
  var serverInit = (appConfig) => {
65
+ var _a;
65
66
  const PORT = process.env.HOST_PORT;
66
67
  const VERSION = process.env.HOST_VERSION;
67
68
  const DOMAIN = process.env.HOST_DOMAIN;
69
+ console.log(process.env);
68
70
  if (!PORT) throw new Error("HOST_PORT is required!");
69
71
  if (!VERSION) throw new Error("HOST_VERSION is required!");
70
72
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
71
- app.register(cors, { origin: true });
73
+ app.register(cors, { origin: ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
72
74
  app.register(
73
75
  fp(async (instance) => {
74
76
  instance.addHook(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/node",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",