https://kotlinlang.org logo
p

PhongBM

10/10/2022, 10:44 AM
Hi everyone. I'm newbie in KotlinJs. I want to build a NodeJs Express using Kotlin. But I don't know how to do it. I created project using IntelliJ (New Project -> Kotlin Multiplatform -> Node.JS Application). What do I need to configure next to use npm express and create APIs.
1
b

Big Chungus

10/10/2022, 11:40 AM
First you need to add express npm dependency and optionally its types dependencies (if it doesn't ship .d.ts files with the main package). From there you can either try using dukat generated glue code or write your own external declarations
If you do end up writing your own external declarations, I've written up my experience with them here
👍 1
Other than that, google and ask questions here as you come up with blockers. Community here is probably the best resource for getting started 😉
p

PhongBM

10/10/2022, 1:25 PM
Thank you. I will checkout and try it.
3 Views