You need an ArcGIS Enterprise for that.
If you have ArcGIS Enterprise, then you could Publish routing services—ArcGIS Server | Documentation for ArcGIS Enterprise.
The REST URL of the routing service, can then be used in WAB.
Jayanta is right. I have also included some really useful resource on how to build your road network which you might find helpful 🙂