vs-nomoex
v1.0.2
Published
Quickly bootstrap an Express.js + MongoDB server with CORS support using a single line.
Readme
🧩 nomoex
Quickly bootstrap an Express.js + MongoDB server with CORS support using a single line.
vs-nomoex is a tiny utility for setting up a development-ready Node.js backend with:
- Express.js
- Mongoose (MongoDB)
- CORS
- JSON parsing
📦 Installation And UseCase
npm install vs-nomoexnpm install vs-nomoeximport {nomoex} from "vs-nomoex"nomoex("Your Mongo URL");
#******************************OR**********************************#
nomoex("mongodb://localhost:27017/myApp", "http://localhost:5173");
#*****************************************************************#
The nomoex function takes up to two parameters. The first parameter is required, while the other one are optional and come with default values.
The first parameter is the MongoDB connection URL, which is mandatory. This is the URI used to connect your backend to a MongoDB database. For example: "mongodb://localhost:27017/myApp".
The second parameter is the CORS origin, which defines which frontend URLs are allowed to access your backend. By default, it is set to true, meaning all origins are allowed. You can pass a specific origin string like "http://localhost:5173" to allow only that frontend.
