How do I serve external css, jpg and gif files from Nanohttpd (Nanohttpd run on a normal pc not on Android)?

核能气质少年 提交于 2019-12-01 11:09:22

Once you send back the HTML file, the browser will run though and make subsequent requests for the other resources - images, JS files, CSS, etc. What you will need to do is look at the "uri" parameter and that will tell you which file you need to send back to the client. Instead of hard-coding "index.html" you will need to base the filename off what is being requested.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!