- update to AdonisJS 6

This commit is contained in:
Kaimbacher 2024-03-14 20:25:27 +01:00
parent f828ca4491
commit cb51a4136f
167 changed files with 21485 additions and 21212 deletions

View file

@ -0,0 +1,27 @@
import type { HttpContext } from '@adonisjs/core/http';
import type { NextFn } from '@adonisjs/core/types/http';
export default class StardustMiddleware {
async handle(ctx: HttpContext, next: NextFn): Promise<void> {
/**
* Middleware logic goes here (before the next call)
*/
// console.log(ctx);
const { pathname } = new URL(ctx.request.completeUrl());
globalThis.stardust = {
...globalThis.stardust,
pathname,
};
/**
* Call next method in the pipeline and return its output
*/
const output = await next();
return output;
}
}
// import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
// export default class StardustMiddleware {
// handle({ request }: HttpContextContract, next: () => Promise<void>): Promise<void>;
// }