Your res.redirect('hello.html')
instruction will have no affect on an AJAX request. AJAX is asynchronous so the request will be made to the server and the response will be returned to the browser to be interpreted by your JavaScript.
To redirect to another page after an AJAX request, you will need to give an extra instruction (window.location.replace('hello.html')
) beneath the console.log('process complete')
instruction.