How to save Json to host location via Ajax?

0
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><title>teste</title><bodystyle="background-color: white">

  <form>
  Primeiro Nome: <input class="nome1" type="text" name="FirstName" value=""><br>
  Segundo Nome: <input  class="nome2" type="text" name="LastName" value=""><br>
  <input class="enviar" type="submit" value="Submit">
  </form>

<script>


$(".enviar").click(function(){

  event.preventDefault();

  nome1 = $(".nome1").val();
  nome2 = $(".nome2").val();

  var banco = [
    {
    nome : nome1,
    sobrenome : nome2
  }
]

  console.log(banco);

  $.post("http://localhost:3000/teste", banco, function(){
    console.log("ok");
  });

});

I have the server error 404 (not found)

Can you help me?

    
asked by anonymous 13.09.2017 / 05:39

0 answers