forked from geolba/tethys.backend
- update to AdonisJS 6
This commit is contained in:
parent
f828ca4491
commit
cb51a4136f
167 changed files with 21485 additions and 21212 deletions
27
app/Middleware/stardust_middleware.ts
Normal file
27
app/Middleware/stardust_middleware.ts
Normal 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>;
|
||||
// }
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue