Created a post controller to publish post data