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_file
key. - Connect realtime database to your firebase project and fill
database url
withweb key
:
ktor {
...
firebase {
service_file = firebase-service.json
database_url = ...firebasedatabase.app
web_key = ...
}
}
-
You can get
Web API key
at Project Settings -> General -> Web API key -
You can get
Database base url
atRealtime Database
->Data
-> root node starting withhttps://...
- Run via main function or with
./gradlew run