
Security News
AI Has Taken Over Open Source
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain
@marko/run-adapter-node
Advanced tools
Preview and deploy @marko/run apps on Connect-style servers
npm install @marko/run-adapter-node
In your application's Vite config file (eg. vite.config.js), import and register this adapter with the @marko/run Vite plugin:
import { defineConfig } from "vite";
import marko from "@marko/run/vite";
import nodeAdapter from "@marko/run-adapter-node";
export default defineConfig({
plugins: [
marko({
adapter: nodeAdapter(),
}),
],
});
This package provides two different middlewares. Both middleware handle converting Connect-style requests to WHATWG requests and similarly writing WHATWG responses back to the Connect response.
This middleware fully handles requests that match a route.
// my-app-server.ts
import express from "express";
import { routerMiddleware } from "@marko/run-adapter-node/middleware";
express()
.use("/assets", express.static("assets"))
.use(routerMiddleware()) // register the router middleware
.listen(8080);
This middleware attaches the matched route onto the request object where it can be invoked later. Along with an invoke function, the object will contain the route's meta data. This is useful if you have other middleware that need to run between finding a match and invoking the route.
// my-app-server.ts
import express from "express";
import { matchMiddleware } from "@marko/run-adapter-node/middleware";
express()
.use("/assets", express.static("assets"))
.use(matchMiddleware()) // register the match middleware
// ...other middleware here
.use((req, res, next) => {
// `req.route` will be populated if the match middleware found a route
if (req.route) {
// do something with `req.route.config` which will contain the route's meta data
}
next();
})
.use((req, res, next) => {
if (req.route) {
// finally invoke the route handler
req.route.invoke(req, res, next);
} else {
next();
}
})
.listen(8080);
For now, check out the examples directory for more info.
FAQs
Preview and deploy @marko/run apps on Connect-style servers
The npm package @marko/run-adapter-node receives a total of 645 weekly downloads. As such, @marko/run-adapter-node popularity was classified as not popular.
We found that @marko/run-adapter-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain

Security News
npm invalidated all granular access tokens that bypass 2FA after a fresh Mini Shai-Hulud wave compromised 323 npm packages. Staged publishing also entered public preview.

Research
/Security News
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.