![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
express-string-controllers
Advanced tools
Reduce imports in your expressjs apps using a controllers wrapper
npm install express-string-controllers --save
yarn add express-string-controllers
If your folder structure is something like this:
index.ts
import express from 'express';
import App, { IExpress } from 'express-string-controllers';
// wrap your express app
const app: IExpress = new App(express());
app.get('/pets', 'PetsController.getPets');
// Replace with your port number
app.listen(4000, () => {
console.log('app started');
});
PetsController.ts
class PetsController {
static async getPets(req, res, next) {
return res.status(200).json({
pets: ['dog', 'cat']
});
}
};
export default PetsController;
You can also dictate your controllers folder path manually:
index.ts
import path from 'node:path';
import express from 'express';
import App, { IExpress } from 'express-string-controllers';
// wrap your express app
const controllersPath = path.resolve(__dirname, './custom/custom_controller');
const app: IExpress = new App(express(), controllersPath);
app.get('/pets', 'PetsController.getPets');
// Replace with your port number
app.listen(4000, () => {
console.log('app started');
});
PetsController.ts
class PetsController {
static async getPets(req, res, next) {
return res.status(200).json({
pets: ['dog', 'cat']
});
}
};
export default PetsController;
For more examples, check the __tests__ folder.
require
./index.js
const path = require('path');
const express = require('express');
const { App } = require("express-string-controllers");
// controller path
const cPath = path.join(__dirname, './controllers');
// init app
const app = new App(express(), cPath);
// define routes
app.get('/ban', 'PetsController.helloWorld');
app.listen(2000, () => { console.log('server started');
});
./controllers/PetsController.js
// default exports
module.exports = class PetsController {
static async helloWorld(req, res, next) {
return res.send('hello world');
}
}
FAQs
Reduce imports with express wrapper
The npm package express-string-controllers receives a total of 1 weekly downloads. As such, express-string-controllers popularity was classified as not popular.
We found that express-string-controllers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.