morseleasy-express
v1.0.0
Published
Morsel easy express project
Downloads
103
Readme
morselEasy-Express
A lightweight and simplified Express.js wrapper designed to help developers build servers faster with clean structure, automatic route loading, built-in global utilities, and easy customization. Perfect for beginners and advanced users who want a minimal but powerful framework on top of Express.
🚀 Features
- ⚡ Easy and fast server initialization
- 📁 Automatic route loading via
express-loader - 🌍 Global access to essential utilities:
app,express,fs,path,chalk - 🎨 Built-in view engine support (EJS by default)
- 🔄 Dynamic view engine switching
- 🧩 Full support for all HTTP methods (
get,post,put, …) - 🛡 Cleaner error logs (optional)
- 🗂 Public folder auto-mount
- 📦 Zero additional configuration
📦 Installation
npm install morseleasy-express📁 File Structure Example
my-project/
│
├── routes/
│ ├── index.js
│ ├── api.js
│
├── views/
│ ├── index.ejs
│
├── public/
│ ├── style.css
│
├── server.js
└── package.json🧩 Basic Usage
const { Server } = require("morselEasy-express");
const server = new Server(3000); // start server on port 3000
// Auto-load all routes
server.expressloader("./routes");🔥 Example Route File (routes/index.js)
module.exports = {
routePath: "/",
method: "get",
run: (req, res) => {
res.send("Welcome to morselEasy-Express!");
}
};🎨 Changing the View Engine
server.setViewEngine("pug", "./other-views");📌 Using HTTP Methods via Server Class
server.get("/hello", (req, res) => {
res.send("Hello world!");
});
server.post("/data", (req, res) => {
res.json({ status: "ok" });
});🪄 Automatic Global Variables
The following become instantly available everywhere:
| Global | Description |
| --------- | ----------------------- |
| app | The Express application |
| express | Express module |
| fs | File system |
| path | Path utilities |
| chalk | Colored console output |
⚠️ Optional: Simple Error Log Mode
(If you integrated error simplifier)
require("morselEasy-express/error-logs")();This will clean stack traces and show only helpful error messages.
❤️ Author
Created by sefa for cleaner, faster, more enjoyable development.
📄 License
MIT License — Free for personal & commercial use.
