Add function upon app.locals