I want to display the content on mobile app. But for that I need rest api for that. Is it possible to display post as restapi?
Not with Hugo.
I think this answer could be more helpful. You can quite easily create an API with the use of custom output formats as described in:
I moved your reply here for posterity.
This topic is archived. If anyone needs something else about Hugo’s Custom Output Formats they can open a new topic.
Fine: you can not create a RESTful API with Hugo; Hugo is a static site generator, and while that means it can be used in a complicated workflow, one should not rely on it for tasks it is clearly not designed.
Sorry @alexandros, I wanted to make it a full answer for posterity. ^_~
No problem.