fix: use express.Router() not require() in ESM patch
The blogroll index.js is an ES module so require() is not defined.
Replace `const { Router } = require("express")` with `express.Router()`
which is already in scope from the module's own top-level import.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,8 +43,7 @@ const patchSpecs = [
|
|||||||
// with a response-shape transformer so the /news static page works.
|
// with a response-shape transformer so the /news static page works.
|
||||||
// The /news page expects: item.link (not .url), item.feedId (not .blog.id),
|
// The /news page expects: item.link (not .url), item.feedId (not .blog.id),
|
||||||
// item.sourceUrl (not .blog.siteUrl), and feedsRes.feeds (not .items).
|
// item.sourceUrl (not .blog.siteUrl), and feedsRes.feeds (not .items).
|
||||||
const { Router } = require("express");
|
const rssapiRouter = express.Router();
|
||||||
const rssapiRouter = Router();
|
|
||||||
rssapiRouter.use((req, res, next) => {
|
rssapiRouter.use((req, res, next) => {
|
||||||
const originalJson = res.json.bind(res);
|
const originalJson = res.json.bind(res);
|
||||||
res.json = function (data) {
|
res.json = function (data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user