Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/users', function(req, res) {
- // Your function to be called goes here.
- });
- $.ajax({
- type: 'GET'
- url: 'http://localhost:8000/users',
- success: function(response) {
- console.log(response);
- },
- error: function(xhr, status, err) {
- console.log(xhr.responseText);
- }
- });
- $("button").click(function(){
- $.ajax({url: "demo_test.txt", success: function(result){
- // your response
- }});
- });
- axios.post('api/tobackend/function',{user:'a',password:'b'})
- .then((res)=>console.log('response from server'))
- router.post('api/tobackend/function',(reqs,resp)=>{console.log('backend')})
Add Comment
Please, Sign In to add comment