error page 404 not found in xampp code example

Example 1: koa-router 404 not found

async getMessages(ctx) {
    const id = ctx.params.id

    const nameOfConversation = await ctx.db.Conversation.findById(id)

    ctx.body = await new Promise((resolve, reject) => {
        firebaseIndex.fbController.getConversation(nameOfConversation.name, async response => {
            resolve(response)
        })
    })
}

Example 2: spring mvc 404 page not found

<web-app ...>

  <servlet>
  	<servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
 	<servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.htm</url-pattern>
  </servlet-mapping>

  //...
  <error-page>
	<error-code>404</error-code>
	<location>/WEB-INF/pages/404.htm</location>
  </error-page>

</web-app>

Tags:

Html Example