You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Server Generation and Website Deployment on Roku #678
I would like to ask if you could share how you manage to generate a server within Roku and, more specifically, how it is possible to deploy a website on it. I have a great interest in learning how to do this.
If possible, could you share any documentation, manual, or a basic example of how to do it? I don't fully understand the code's functionality.
Here are the pieces that make it work:
First, the client is built from a svelte project from https://github.com/iBicha/playlet/tree/main/playlet-web but it can be any arbitrary html/js/css files. The build process spits the output files under playlet-lib/src/www.
The second piece is the web server, Playlet has a web server that listens for tcp connections, parses and exchanges HttpMessages with the client. The server is a Task component that continuously listens for new connections and messages. The functionality of the web server is located here
The server has milddewares (similar to most web servers out there) that allows me to specify specific handlers for certain paths/routes and methods (for example GET /index.html) that is setup here
The static files are served using HttpStaticFilesRouterhere, this way I can map url path to files from the playlet lib package.
This router is also used to allow the web app to download logs for example.
Here's one of the simplest routers in the server, it redirects from / to /index.html. From there, the HttpStaticFilesRouter router will serve the content of /index.html which allows the client to show the web app.
The other routers allow me to have a somewhat "restful" api that connects between the client and the server, mostly communicating with json data.
Finally, you might notice that some router functions are annotated, for example
@get("/api/dash")
function GenerateDashManifest(context as object) as boolean
request = context.request
response = context.response
This is later interpreted by the web-server-plugin, so that this function is called when the method is a GET and the path is /api/dash - it's just to simplify my life since Playlet has many routers.
There are other things to talk about (different headers, caching with etags, the fact that static files are already gzipped at build time, etc) but this is as good as general intro gets. Feel free to ask questions if you have specifics.
Activity
iBicha commentedon Jul 18, 2025
I have some docs, but not too deep https://github.com/iBicha/playlet/tree/main/docs#playlet-web-app
Here are the pieces that make it work:
First, the client is built from a svelte project from https://github.com/iBicha/playlet/tree/main/playlet-web but it can be any arbitrary html/js/css files. The build process spits the output files under
playlet-lib/src/www.The second piece is the web server, Playlet has a web server that listens for tcp connections, parses and exchanges HttpMessages with the client. The server is a Task component that continuously listens for new connections and messages. The functionality of the web server is located here
The server has milddewares (similar to most web servers out there) that allows me to specify specific handlers for certain paths/routes and methods (for example
GET /index.html) that is setup hereThe static files are served using
HttpStaticFilesRouterhere, this way I can map url path to files from the playlet lib package.This router is also used to allow the web app to download logs for example.
Here's one of the simplest routers in the server, it redirects from
/to/index.html. From there, theHttpStaticFilesRouterrouter will serve the content of/index.htmlwhich allows the client to show the web app.The other routers allow me to have a somewhat "restful" api that connects between the client and the server, mostly communicating with json data.
Finally, you might notice that some router functions are annotated, for example
This is later interpreted by the web-server-plugin, so that this function is called when the method is a
GETand the path is/api/dash- it's just to simplify my life since Playlet has many routers.There are other things to talk about (different headers, caching with etags, the fact that static files are already gzipped at build time, etc) but this is as good as general intro gets. Feel free to ask questions if you have specifics.
iBicha commentedon Jul 18, 2025
Converting this issue to a discussion