When you say "add to map", is that map only for you displaying on your computer? Or, do you want to pass the URL of the web app so that you can share it?
In order to share your data or layer, you have to host it as a service either on your ArcGIS Server machine, or put it on arcgis.com.