i load inicio.jade with ajax req
$.ajax(
{
url:'/inicio',
cache: false,
type: 'GET',
}).done(function(web)
{
$('#contenido_nav_principal').fadeOut(600,function()
{
$('#contenido_nav_principal').empty();
$('#contenido_nav_principal').html(web);
$('#navegacion').animate({height:'600px'},200);
$('#contenido_nav_principal').fadeIn(600);
});
});
from this address in the server
app.get('/inicio',routes.inicio.inicio);
the problem is that i can access to the page with http://www.mypage.com/inicio
how can i restrict the access only to ajax requests and redirect to 404 error page if is not an ajax request