Can I serve my compose application using ktor? I w...
# compose-web
d
Can I serve my compose application using ktor? I want to create a server that hosts a rest API for all platforms and also the web version Right now I only succeeded in running the compose application as a kotlin/js application
h
Yes. The resulting JS files are plain normal static JS files you can serve like any other static file with Ktor (or any other platform like GitHub pages, etc.)
d
Is Github pages free?
I use compose web using canvas tho
h
Yes, if your pages will be public accessible.
d
Do I have to use browser instead of nodejs?
I still don't understand the difference between them
p
To deploy a static JS webpage you don't need nodejs, just research how to serve files with ktor and deploy ktor in any cloud hosting alternative. I use Google AppEngine but there is many. If no need ktor, just a JS webpage you can use firebase hosting, is free, however a custom domain and features like that you have to pay.
d
Creating a ktor server that serves static files is easy! Check out: https://ktor.io/docs/serving-static-content.html If you're using GHP however, all you need to do is check in the html / js files to the right place and it will serve them for you.
d
Where does gradle generate the static files for ktor?
d
My recommendation to figure out what Gradle is doing is by going into your project, running
./gradlew clean
, and then running
./gradlew build
. Then, search your
build/
folder for
*.js
files.