routing-controllers
routing-controllers copied to clipboard
fix: empty page on @Render() responds with 404
Description
When the page specified in the @Render()
decorator returns an empty string, the server responds with the status code 404 (Not Found).
Minimal code-snippet showcasing the problem
import { Controller, Get, Render } from 'routing-controllers';
@Controller()
export class MyController {
@Get()
@Render('index.pug') // index.pug must be empty
index() {
}
}
Expected behavior
The server should send an empty body and respond with 200 (OK).
Actual behavior
The server sends the error page and responds with 404 (Not Found).