Ktor + WebSockets + Firebase => backend for simple chat with one room and reactions!
- Create Firebase project at
- Download services.json file and place it at
src/jvmMain/resources/firebase-service.json. You can specify custom config path in application.confapplication.conf withservice_filekey. - Connect realtime database to your firebase project and fill
database urlwithweb key:
ktor {
...
firebase {
service_file = firebase-service.json
database_url = ...firebasedatabase.app
web_key = ...
}
}-
You can get
Web API keyat Project Settings -> General -> Web API key -
You can get
Database base urlatRealtime Database->Data-> root node starting withhttps://...
- Run via main function or with
./gradlew run