How to get local time from web server? : I set up an ajax server with this settings

```

    let express = require('express');
    let server = express();

    server.use('/MyWebApp', express.static(__dirname + '/public'));

    server.get('/MyWebApp/dateService', function(request, response){        
        response.send({'dateTime' : new Date()});
    });

    server.listen(2019);
    console.log('server running on port 2019 ...')

````

I want to get the local time and have this function in my html 

```
function getDateTime(){
                
                $.get({
                    
                    url: "http://localhost:2019/MyWebApp/dateService",
                    dataType: "json",
                    success: function(result){
                        document.getElementById("timer").innerHTML = result;
                    }
                }); 
            }
```

But when I click the button, it doesn't work and I don't know why?

```
<div id="timer">Random Text</div>
            
<input type="button" value="Server-Request" onclick="getDateTime()"/>
            
```
