@gustavo-valsechi/node 1.0.23 → 1.0.24

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
@@ -240,7 +240,10 @@ var serverInit = (appConfig) => {
240
240
  if (!PORT) throw new Error("HOST_PORT is required!");
241
241
  if (!VERSION) throw new Error("HOST_VERSION is required!");
242
242
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
243
- app.register(import_cors.default, { origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
243
+ app.register(import_cors.default, {
244
+ methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
245
+ origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true
246
+ });
244
247
  app.register(
245
248
  (0, import_fastify_plugin.default)(async (instance) => {
246
249
  instance.addHook(
package/dist/index.mjs CHANGED
@@ -210,7 +210,10 @@ var serverInit = (appConfig) => {
210
210
  if (!PORT) throw new Error("HOST_PORT is required!");
211
211
  if (!VERSION) throw new Error("HOST_VERSION is required!");
212
212
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
213
- app.register(cors, { origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
213
+ app.register(cors, {
214
+ methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
215
+ origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true
216
+ });
214
217
  app.register(
215
218
  fp(async (instance) => {
216
219
  instance.addHook(
@@ -94,7 +94,10 @@ var serverInit = (appConfig) => {
94
94
  if (!PORT) throw new Error("HOST_PORT is required!");
95
95
  if (!VERSION) throw new Error("HOST_VERSION is required!");
96
96
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
97
- app.register(import_cors.default, { origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
97
+ app.register(import_cors.default, {
98
+ methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
99
+ origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true
100
+ });
98
101
  app.register(
99
102
  (0, import_fastify_plugin.default)(async (instance) => {
100
103
  instance.addHook(
@@ -70,7 +70,10 @@ var serverInit = (appConfig) => {
70
70
  if (!PORT) throw new Error("HOST_PORT is required!");
71
71
  if (!VERSION) throw new Error("HOST_VERSION is required!");
72
72
  if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
73
- app.register(cors, { origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true });
73
+ app.register(cors, {
74
+ methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
75
+ origin: process.env.NODE_ENV === "dev" || ((_a = process.env.CORS_HOSTS) == null ? void 0 : _a.split(";")) || true
76
+ });
74
77
  app.register(
75
78
  fp(async (instance) => {
76
79
  instance.addHook(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/node",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",