我是新來的vertx-web。我正在使用ruby vertx-web構建Web應用程序。我想提供靜態文件(index.html)。和我的index.html包裝在webroot文件夾中。 我的index.html文件將加載爲http://localhost:8088。我需要爲localhost提供index.html:8088/demo或localhost:8088/test或http://localhost:8088/ *(*可以是任何內容,它應該提供index.html)。Vertx網路由
目錄結構:
前端
根目錄
- 的index.html
- index.css
sever.rb
任何幫助將不勝感激。
Hi niraj,router.route_with_regex(「。*/index.html」)。handler(){| ctx | response = ctx.response() response.put_header(「content-type」,「text/html」) response.set_ Chunked(true) response.send_file(「webroot/index.html」) } index.html,但不會加載index.html中的css和js文件 –