We all love Express.js for its simplicity and flexibility — but let’s face it, it's starting to feel... a bit manual. If you’ve ever wanted the developer experience of Next.js but with the power of Express, you're going to love this.
Introducing Monpress — a modern, lightweight framework for building APIs using Express.js and TypeScript.
Monpress keeps the raw power of Express, but brings in modern conventions like:
✅ File-based routing
✅ RESTful method exports
✅ Optional & dynamic route parameters
✅ Global middleware support
✅ Built-in CLI for scaffolding and development
⚡ Why Monpress Is More Than Just a CLI
This isn’t just a helper script — Monpress is a full framework designed for backend developers who want speed and structure.
Think of it as:
- The Next.js of Express
- A faster way to build APIs without boilerplate
- An expressive and scalable structure for real-world backends
🧱 Opinionated, but Flexible
Monpress gives you structure, but doesn't lock you in. Want to plug in a database, auth provider, or custom middleware? Go for it. You still have full access to the underlying Express app.
🔧 Core Concepts
1. 📁 File-Based Routing
Your folder = your API.
routes/
├── index.ts → GET /
├── blog.ts → GET /blog
├── blog/[id].ts → GET /blog/:id
Want to make a route optional? Just add an underscore:
routes/user/[id_].ts → /user/:id?
2. 🧩 REST Method Exports
Instead of juggling app.get()
and router.post()
, just export methods like this:
// routes/hello.ts
import { httpRequest } from "monpress";
export const GET = httpRequest((req, res) => {
res.json({ message: "Hello from GET" });
});
export const POST = httpRequest((req, res) => {
res.json({ message: "Posted!" });
});
3. 🔐 Global Middleware
Need auth, CORS, or logging across your app?
// middlewares/logger.ts
import { middleware } from "monpress";
export const logger = middleware((req, _res, next) => {
console.log(`[${req.method}] ${req.path}`);
next();
});
Register it globally:
import { MonPress } from "monpress";
import routes from "./routes";
const mon = MonPress({
routes,
middleware: [logger],
});
🚀 Quickstart
npm install -g monpress
monpress create
cd my-project
monpress dev
Then drop a file in routes/
and start building!
💡 Why Monpress?
Feature | Monpress |
---|---|
Framework | ✅ |
Express under the hood | ✅ |
File-based routing | ✅ |
RESTful method exports | ✅ |
Global middleware | ✅ |
Dev CLI | ✅ |
TypeScript-first | ✅ |
If you're building modern APIs, Monpress gives you speed, structure, and simplicity — all powered by the Express engine you already know and love.
📦 Try It Now
npm install -g monpress
🙌 Join the Journey
I built Monpress to simplify backend development and bring modern DX to Express. I’d love your feedback, ideas, or contributions.
Let’s build something awesome — together.
🔗 GitHub: https://github.com/souravbapari1/mon