express javascript node.js

How do I call a function at start in Expressjs/nodejs (Setup method)

I want my worker server to pickup tasks from parent server immediately after it starts and keep pinging for pending tasks.

Given that Nodejs is a event driven, how do I make my express server make a rest call to server and start working immediately after start?

In a way, I am asking for setup method in Nodejs.