import { BaseMiddleware } from "@triptyk/nfw-core" ; import { Request , Response } from "express" ; import * as JSONAPISerializer from "json-api-serializer" ; import { singleton } from "tsyringe" ; @ singleton ( ) export class NotFoundMiddleware extends BaseMiddleware { private serializer = new JSONAPISerializer ( ) ; public use ( req , res , next , args ) { res . status ( 404 ) ; res . json ( this . serializer . serializeError ( { detail : "Not found" , status : "404" } ) ) ; } }