Not found  

Middleware to show a custom page on 404 errors.

Description

This middleware shows a not-found page on 404 errors. Optionally, it can create a directoryIndex for folders.

Installation

This middleware must be used with Lume's HTTP Server.

Create an entry point file (for example, serve.ts) with the following code:

import Server from "@lumeland/core/server.ts";
import notFound from "@lumeland/plugin-not-found";

const server = new Server();

server.use(notFound({
  page404: "/404.html", // Default value
}));

server.start();

Local development

This middleware is used by default by Lume in --serve mode with the value of the page404 option.