Wisp logging bs
This commit is contained in:
parent
620ad25c61
commit
35680e719b
2 changed files with 8 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import wisp from 'wisp-server-node';
|
|||
import rammerhead from '@rubynetwork/rammerhead';
|
||||
import { FastifyServerFactory, FastifyServerFactoryHandler, RawServerDefault } from 'fastify';
|
||||
import { parsedDoc } from './config.js';
|
||||
import { LOG_LEVEL, WispOptions } from 'wisp-server-node/dist/Types.js';
|
||||
|
||||
const rh = rammerhead.createRammerhead({
|
||||
logLevel: parsedDoc.server.server.logging ? 'debug' : 'disabled',
|
||||
|
|
@ -11,6 +12,11 @@ const rh = rammerhead.createRammerhead({
|
|||
disableHttp2: parsedDoc.server.rammerhead.http2 ? false : true
|
||||
});
|
||||
|
||||
const wispOptions: WispOptions = {
|
||||
logLevel: parsedDoc.server.server.logging ? LOG_LEVEL.DEBUG : LOG_LEVEL.NONE,
|
||||
pingInterval: 30
|
||||
}
|
||||
|
||||
const serverFactory: FastifyServerFactory = (handler: FastifyServerFactoryHandler): RawServerDefault => {
|
||||
const httpServer = createServer();
|
||||
httpServer.on('request', (req, res) => {
|
||||
|
|
@ -27,7 +33,7 @@ const serverFactory: FastifyServerFactory = (handler: FastifyServerFactoryHandle
|
|||
}
|
||||
else if (parsedDoc.server.server.wisp) {
|
||||
if (req.url?.endsWith('/wisp/')) {
|
||||
wisp.routeRequest(req, socket as any, head);
|
||||
wisp.routeRequest(req, socket as any, head, wispOptions);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Pagnation from "./pagnation.astro";
|
|||
const { page } = Astro.params;
|
||||
|
||||
const response = await fetch(new URL("/api/catalog-assets/", Astro.url));
|
||||
console.log(new URL("/api/catalog-assets/", Astro.url));
|
||||
//console.log(new URL("/api/catalog-assets/", Astro.url));
|
||||
const assetsJson = await response.json();
|
||||
|
||||
const nextPage = parseInt(page!) + 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue