cherry

roboli 2024-10-18T00:13:47.775949Z

Hi there. So I'm doing the following:

(ns hello-server
  (:require ["express" :as xp]))

(defn build-server []
  (let [srv (xp)]
    (.get srv "/" (fn handle [req res]
                    (.send res "Hello World!")))
    srv))
But it throws an error complaining on xp.call is not a function. Looking at the mjs output code it has import * as xp from 'express';. How can I make it to output import {default as xp} from 'express'; or better yet import express from 'express';. Thanks :)

borkdude 2024-10-18T06:42:43.902669Z

Add $default inside the string after the name of the lib, that Is standard CLJS notation

borkdude 2024-10-18T06:43:13.207149Z

Also express.default works

🙏 1