owebjs 1.1.2 → 1.1.4
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.d.ts +1 -0
- package/dist/structures/Oweb.js +6 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { FastifyRegister, FastifyRegisterOptions, RegisterOptions } from 'fastif
|
|
|
16
16
|
export { FastifySchema, FastifySchemaCompiler, FastifySchemaValidationError, SchemaErrorDataVar, SchemaErrorFormatter } from 'fastify/types/schema';
|
|
17
17
|
export { FastifyServerFactory, FastifyServerFactoryHandler } from 'fastify/types/serverFactory';
|
|
18
18
|
export { FastifyTypeProvider, FastifyTypeProviderDefault } from 'fastify/types/type-provider';
|
|
19
|
+
export { HTTPMethods } from 'fastify/types/utils';
|
|
19
20
|
|
|
20
21
|
interface OwebOptions extends FastifyServerOptions {
|
|
21
22
|
uWebSocketsEnabled?: boolean;
|
package/dist/structures/Oweb.js
CHANGED
|
@@ -32,7 +32,12 @@ class Oweb extends _FastifyInstance {
|
|
|
32
32
|
return server;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
const fastifyInstance = Object.assign(this, Fastify(this._options));
|
|
36
|
+
this.addHook("onRequest", (_, res, done) => {
|
|
37
|
+
res.header("X-Powered-By", "Oweb");
|
|
38
|
+
done();
|
|
39
|
+
});
|
|
40
|
+
return fastifyInstance;
|
|
36
41
|
}
|
|
37
42
|
loadRoutes({ directory }) {
|
|
38
43
|
return assignRoutes(directory, this);
|