I am new to Hyperledger. I want to know if I can expose RESTful API from the playground as we can do from CLI using composer-rest-server.
The playground offers an easy and visual way to build a composer network definition and then test it. Once you're happy your models and chaincode function as expected, at that point you can use the playground to actually deploy your resulting bna to an actual, real network, using a real network card.
composer-rest-server needs a network card to be able to talk to your network and discover your models and chaincode.
Hopefully you can now see the correlation. You can't expose a rest api against the playground as it's nothing more than a development and test environment for your bna.
So, you deploy your network and then you generate the api against a real network card.