This codemod automates the process of updating API names from Connect to Express in your project. The codemod is specifically designed to align your codebase with the new naming conventions introduced after switching from Connect to Express in Meteor 3.0.
You can find the implementation of this codemod in the Studio here.
Overview
This codemod updates the following API names:
WebApp.connectHandlers.use(middleware)
is nowWebApp.handlers.use(middleware)
.WebApp.rawConnectHandlers.use(middleware)
is nowWebApp.rawHandlers.use(middleware)
.WebApp.connectApp
is nowWebApp.expressApp
.
Examples
Example 1: Updating Middleware Handlers
This codemod updates the API names for middleware handlers.
Before
WebApp.connectHandlers.use(middleware);WebApp.rawConnectHandlers.use(middleware);
After
WebApp.handlers.use(middleware);WebApp.rawHandlers.use(middleware);
Example 2: Updating WebApp Instance
This codemod updates the WebApp.connectApp
to the new WebApp.expressApp
.
Before
const app = WebApp.connectApp;
After
const app = WebApp.expressApp;
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community