Not found

Atlet allows you to define a handler that will be called when a client requests a page or an endpoint that does not exist.

You can define this handler using the NOT_FOUND symbol, under which you can define your route function that will return the desired output.

/**@jsx h */
/**@jsxFrag Fragment */
import { serve } from 'https://deno.land/std/http/server.ts'
import { createHandler, NOT_FOUND, h, Fragment } from 'https://deno.land/x/atlet@1.2.0/mod.ts'

const handler = await createHandler({
  '/': () => (
    <section>
      <a href="/free-download-page">Go to the free download page</a>
    </section>
  ),
  [NOT_FOUND]: () => (
    <h1>You fool.</h1>
  ),
})

// you can also use Deno.serve which is available in Deno 1.35
serve(handler)