You could use i-jetty, a webserver for android.
Also there are some resources for your question:
- RESTful Web Services Implementations in Mobile Devices
- Android - Create RESTful WebService - Host it on mobile
However, according to this answer:
...mobile networks (wifi and 3g) mostly use NAT, which prevents inbound connections. This makes mobile devices inaccessible from the internet (inbound) while they can still initiate outbound connections. For this reason mobile devices mostly do not host servers.
It could also drain your device's battery.
Hope this clarifies your doubts.