Adding publish method in spa application