@gustavo-valsechi/node 1.0.16 → 1.0.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/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/dist/src/router/index.js +1 -0
- package/dist/src/router/index.mjs +1 -0
- package/dist/src/server/index.d.mts +6 -2
- package/dist/src/server/index.d.ts +6 -2
- package/dist/src/server/index.js +2 -0
- package/dist/src/server/index.mjs +2 -0
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -229,6 +229,7 @@ var healthRouter = (router, options, done) => {
|
|
|
229
229
|
// src/server/index.ts
|
|
230
230
|
var import_fastify = __toESM(require("fastify"));
|
|
231
231
|
var import_fastify_plugin = __toESM(require("fastify-plugin"));
|
|
232
|
+
var import_cors = __toESM(require("@fastify/cors"));
|
|
232
233
|
var app = (0, import_fastify.default)();
|
|
233
234
|
var serverInit = (appConfig) => {
|
|
234
235
|
const PORT = process.env.HOST_PORT;
|
|
@@ -237,6 +238,7 @@ var serverInit = (appConfig) => {
|
|
|
237
238
|
if (!PORT) throw new Error("HOST_PORT is required!");
|
|
238
239
|
if (!VERSION) throw new Error("HOST_VERSION is required!");
|
|
239
240
|
if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
|
|
241
|
+
app.register(import_cors.default, { origin: true });
|
|
240
242
|
app.register(
|
|
241
243
|
(0, import_fastify_plugin.default)(async (instance) => {
|
|
242
244
|
instance.addHook(
|
package/dist/index.mjs
CHANGED
|
@@ -199,6 +199,7 @@ var healthRouter = (router, options, done) => {
|
|
|
199
199
|
// src/server/index.ts
|
|
200
200
|
import fastify from "fastify";
|
|
201
201
|
import fp from "fastify-plugin";
|
|
202
|
+
import cors from "@fastify/cors";
|
|
202
203
|
var app = fastify();
|
|
203
204
|
var serverInit = (appConfig) => {
|
|
204
205
|
const PORT = process.env.HOST_PORT;
|
|
@@ -207,6 +208,7 @@ var serverInit = (appConfig) => {
|
|
|
207
208
|
if (!PORT) throw new Error("HOST_PORT is required!");
|
|
208
209
|
if (!VERSION) throw new Error("HOST_VERSION is required!");
|
|
209
210
|
if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
|
|
211
|
+
app.register(cors, { origin: true });
|
|
210
212
|
app.register(
|
|
211
213
|
fp(async (instance) => {
|
|
212
214
|
instance.addHook(
|
package/dist/src/router/index.js
CHANGED
|
@@ -74,6 +74,7 @@ var healthRouter = (router, options, done) => {
|
|
|
74
74
|
// src/server/index.ts
|
|
75
75
|
var import_fastify = __toESM(require("fastify"));
|
|
76
76
|
var import_fastify_plugin = __toESM(require("fastify-plugin"));
|
|
77
|
+
var import_cors = __toESM(require("@fastify/cors"));
|
|
77
78
|
var app = (0, import_fastify.default)();
|
|
78
79
|
|
|
79
80
|
// src/router/api.ts
|
|
@@ -2,7 +2,11 @@ import * as fastify from 'fastify';
|
|
|
2
2
|
import { FastifyInstance } from 'fastify';
|
|
3
3
|
import * as http from 'http';
|
|
4
4
|
|
|
5
|
-
declare const app: FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault
|
|
6
|
-
|
|
5
|
+
declare const app: FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
|
|
6
|
+
__linterBrands: "SafePromiseLike";
|
|
7
|
+
};
|
|
8
|
+
declare const serverInit: (appConfig?: (app: FastifyInstance) => void) => FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
|
|
9
|
+
__linterBrands: "SafePromiseLike";
|
|
10
|
+
};
|
|
7
11
|
|
|
8
12
|
export { app, serverInit };
|
|
@@ -2,7 +2,11 @@ import * as fastify from 'fastify';
|
|
|
2
2
|
import { FastifyInstance } from 'fastify';
|
|
3
3
|
import * as http from 'http';
|
|
4
4
|
|
|
5
|
-
declare const app: FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault
|
|
6
|
-
|
|
5
|
+
declare const app: FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
|
|
6
|
+
__linterBrands: "SafePromiseLike";
|
|
7
|
+
};
|
|
8
|
+
declare const serverInit: (appConfig?: (app: FastifyInstance) => void) => FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
|
|
9
|
+
__linterBrands: "SafePromiseLike";
|
|
10
|
+
};
|
|
7
11
|
|
|
8
12
|
export { app, serverInit };
|
package/dist/src/server/index.js
CHANGED
|
@@ -83,6 +83,7 @@ var mainRouter = (router, options, done) => {
|
|
|
83
83
|
|
|
84
84
|
// src/server/index.ts
|
|
85
85
|
var import_fastify_plugin = __toESM(require("fastify-plugin"));
|
|
86
|
+
var import_cors = __toESM(require("@fastify/cors"));
|
|
86
87
|
var app = (0, import_fastify.default)();
|
|
87
88
|
var serverInit = (appConfig) => {
|
|
88
89
|
const PORT = process.env.HOST_PORT;
|
|
@@ -91,6 +92,7 @@ var serverInit = (appConfig) => {
|
|
|
91
92
|
if (!PORT) throw new Error("HOST_PORT is required!");
|
|
92
93
|
if (!VERSION) throw new Error("HOST_VERSION is required!");
|
|
93
94
|
if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
|
|
95
|
+
app.register(import_cors.default, { origin: true });
|
|
94
96
|
app.register(
|
|
95
97
|
(0, import_fastify_plugin.default)(async (instance) => {
|
|
96
98
|
instance.addHook(
|
|
@@ -59,6 +59,7 @@ var mainRouter = (router, options, done) => {
|
|
|
59
59
|
|
|
60
60
|
// src/server/index.ts
|
|
61
61
|
import fp from "fastify-plugin";
|
|
62
|
+
import cors from "@fastify/cors";
|
|
62
63
|
var app = fastify();
|
|
63
64
|
var serverInit = (appConfig) => {
|
|
64
65
|
const PORT = process.env.HOST_PORT;
|
|
@@ -67,6 +68,7 @@ var serverInit = (appConfig) => {
|
|
|
67
68
|
if (!PORT) throw new Error("HOST_PORT is required!");
|
|
68
69
|
if (!VERSION) throw new Error("HOST_VERSION is required!");
|
|
69
70
|
if (!DOMAIN) throw new Error("HOST_DOMAIN is required!");
|
|
71
|
+
app.register(cors, { origin: true });
|
|
70
72
|
app.register(
|
|
71
73
|
fp(async (instance) => {
|
|
72
74
|
instance.addHook(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"typeorm": "0.3.26"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@fastify/cors": "11.2.0",
|
|
24
25
|
"body-parser": "2.2.1",
|
|
25
26
|
"dotenv": "16.4.5",
|
|
26
27
|
"lodash": "4.17.21",
|
|
@@ -34,14 +35,14 @@
|
|
|
34
35
|
"eslint": "9.1.1",
|
|
35
36
|
"fastify": "5.6.2",
|
|
36
37
|
"fastify-plugin": "5.1.0",
|
|
37
|
-
"pg": "8.11.5",
|
|
38
38
|
"morgan": "1.10.0",
|
|
39
|
-
"
|
|
40
|
-
"vitest": "3.0.5",
|
|
39
|
+
"pg": "8.11.5",
|
|
41
40
|
"rimraf": "6.1.0",
|
|
42
41
|
"tsc-alias": "1.8.16",
|
|
43
42
|
"tsup": "8.5.0",
|
|
44
|
-
"typeorm": "0.3.26"
|
|
43
|
+
"typeorm": "0.3.26",
|
|
44
|
+
"typescript": "5.4.5",
|
|
45
|
+
"vitest": "3.0.5"
|
|
45
46
|
},
|
|
46
47
|
"publishConfig": {
|
|
47
48
|
"access": "public"
|