@101-ways/core-mongo-express
v0.1.0
Published
Accelerator Mongo and Express package.
Downloads
4
Readme
@101-ways/core-mongo-express
Express + MongoDB accelerator package. It uses the Service Registry pattern to create a single object with APIs.
Usage
import { load } from '@101-ways/core-mongo-express';
load([`${__dirname}/modules`]).then((sr) => {
const collection = sr.mongo.db().collection('test');
sr.express.app.get('/hello', async (req, res) => {
const results = await collection.find({}).toArray();
res.json({ results });
});
});
Service Registry API
Combination of @101-ways/core-express and @101-ways/core-mongo.
Environment Variables
Combination of @101-ways/core-express and @101-ways/core-mongo.