
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
convexpress
Advanced tools
Employ conventions to register express routes. This is done by creating route definition objects - convroutes - which:
npm install --save convexpress
/* File: src/api-root/pets/get.js */
import dbClient from "services/db";
export const path = "/pets";
export const method = "get";
export const description = "List pets";
export const tags = ["pets"];
export const responses = {
"200": {
description: "pets list"
}
};
export const parameters = [{
name: "status",
description: "Filter by pet status (e.g. available / not available)"
in: "query",
required: false,
type: "string",
}];
export async function handler (req, res) {
const pets = await dbClient.query(
`SELECT * FROM pets WHERE status = ${req.query.status}`
);
res.status(200).send(pets);
}
/* File: src/server.js */
import express from "express";
import convexpress from "convexpress";
import * as petsGet from "api-root/pets/get";
import * as petsPost from "api-root/pets/post";
const options = {
info: {
title: "pet store",
version: "1.0.0"
},
host: "localhost:3000"
};
const api = convexpress(options)
// Serve swagger definition at /swagger.json
.serveSwagger()
.convroute(petsGet)
.convroute(petsPost);
const server = express()
.use(api)
.listen(process.env.PORT)
Create an express router object (convrouter), which the additional methods
convroute and serveSwagger.
options object: top-level properties of the swagger definition
The express router (convrouter).
Registers a convroute.
convroute object required: a convroute definition object:
path string requiredmethod string requiredhandler function required_paramters Array< object >middleware Array< function >description stringtags Array< string >responses Map< object >The convrouter, to allow for method chaining.
Registers the route GET /swagger.json for serving the swagger definition, and
the route GET /swagger/ for serving the swagger UI html.
None.
The convrouter, to allow for method chaining.
After cloning the repository, install dependencies with npm install. Run
npm test to run unit tests, or npm run dev to re-run them automatically
when files change.
FAQs
Employ conventions to register express routes
The npm package convexpress receives a total of 40 weekly downloads. As such, convexpress popularity was classified as not popular.
We found that convexpress demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.