Building42 / Telegraph

Secure Web Server for iOS, tvOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I return a index.html when some URL load?

YiYiZheng opened this issue · comments

How can I write the code? Thanks

@YiYiZheng You can serve index.html by putting the file in your bundle resources and calling server.serveBundle(.main, "/") when you setup your server. This is documented and implemented in the demo server, check it out!

The demo code is here:

server.serveBundle(.main, "/")