Q:

How to invoke app.js function from html page in expressjs?

I want to invoke function init() { // } present in app.js  from html  page  from 
<a href='javascript:init();'> invoke init </a>

The problem with the above code is, that it looks for function init() only at the client side, whereas I want to invoke function init() at the express server app.js. 

A:

Despite using the same language, client and server have no direct ties to each other. They're still bound to communicating with HTTP or WebSockets.
So, you'll need to establish a route that will call init() when requested:
app.get('/init', function (req, res) {
    init();
    // res.send(...), etc.
});

Then have the client either navigate to it:
<a href="/init"> invoke init </a>

Or, request it via Ajax:
function init() {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', '/init');
    xhr.send();
}

