0.1.0 • Published 1 year ago

@101-ways/core-mongo-express v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@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.