Hi I ran this example on my machine and it says markoExpress() is not a function. Any ideas ? This is example from https://markojs.com/docs/express/
require("@marko/compiler/register"); // Allow Node.js to require and load `.marko` files
var express = require("express");
var markoExpress = require("@marko/express");
var template = require("./template");
var app = express();
app.use(markoExpress()); //enable res.marko(template, data)
app.get("/", function (req, res) {
res.marko(template, {
name: "Frank",
count: 30,
colors: ["red", "green", "blue"]
});
});
app.listen(8080);
The issue is that
@marko/expressis authored as an es module and the commonjs export for it exposes a.defaultproperty.If consuming from commonjs you must do something like the following: