Guest User

Untitled

a guest
Dec 22nd, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. app.get('/users', function(req, res) {
  2. // Your function to be called goes here.
  3. });
  4.  
  5. $.ajax({
  6. type: 'GET'
  7. url: 'http://localhost:8000/users',
  8. success: function(response) {
  9. console.log(response);
  10. },
  11. error: function(xhr, status, err) {
  12. console.log(xhr.responseText);
  13. }
  14. });
  15.  
  16. $("button").click(function(){
  17. $.ajax({url: "demo_test.txt", success: function(result){
  18. // your response
  19. }});
  20. });
  21.  
  22. axios.post('api/tobackend/function',{user:'a',password:'b'})
  23. .then((res)=>console.log('response from server'))
  24.  
  25. router.post('api/tobackend/function',(reqs,resp)=>{console.log('backend')})
Add Comment
Please, Sign In to add comment