How to return 404 HTTP code with ember fastboot?


#1

I have the 404 route and if a page is not found FastBoot returns the right page but it’s returned with the 200 HTTP code. How to set the 404 HTTP code for the 404 route?


#2

I added this code to my not-found route

actions: {
    didTransition() {
        if (this.get('fastboot.isFastBoot')) {
            this.set('fastboot.response.statusCode', 404);
        }
    }
}

And it works well