NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.96k stars 1.7k forks source link

Local Hosting Android #424

Open s1mar opened 7 years ago

s1mar commented 7 years ago

I'm placing my website folder in my apps asset folder,how can I set nanohttpd for this ?!?

HussainYousuf commented 7 years ago

Just put all content in asset folder and access them by InputStream is = MainActivity.getAssets().open("script.js"); This will return an input stream you can something like this return newFixedLengthResponse(Response.Status.OK, "text/javascript", is, is.available());