DEV Community

Manoj Gowda
Manoj Gowda

Posted on

A New Way of Setting Up an Express Server for Lazy Developers npm i mbfi

mbfi is a utility package that streamlines the process of setting up an Express server with MongoDB and Mongoose, along with essential features like routing, validation, and logging. It simplifies common tasks, allowing you to focus more on building your application and less on boilerplate code. This package includes support for MongoDB connection, schema validation, logging via morgan, CORS handling, and basic routing.

Features
Express Server Setup: Simplifies the process of setting up an Express server.
MongoDB and Mongoose Integration: Easily connect to MongoDB using Mongoose and handle database operations.
Schema Validation: Use simple validation to define your Mongoose schemas.
CORS Support: Handles Cross-Origin Resource Sharing (CORS) to allow resources to be shared across different domains.
Logging with Morgan: Set up logging to track requests and monitor your server's activity.
Router Handling: Easily manage routes with multiple routers for your application.
Reusable Components: Helps reduce time in setting up basic server configurations, Mongoose models, and middleware.
Installation
Install the package via npm:

npm install mbfi
How to Use

https://www.npmjs.com/package/mbfi

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series