
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
mongo-services
Advanced tools
Creates services using a provided model and mongoose connection, and exposes them via RESTful API.
Creates services using a provided model and mongoose connection, and exposes them via RESTful API. Built on top of Express.
A tool for rapidly prototyping APIs. Inspired by the Feathers service design.
####Start by establishing a mongoose connection
var app = require('express')();
app.db = require('mongoose').connect('mongodb://localhost/test');
var services = require('mongo-services')(app);
services.add('messages', new Schema({
text: String
}));
####Then access them from anywhere in your app using app.service():
app.service('messages').find({}, function(err, messages) {
if (!err) console.log(messages);
});
####The following service methods are available:
####Automatically set up a RESTful API:
services.configureREST();
Which adds the following routes:
POST /messages (create)GET /messages/id (get)GET /messages/ (find)PUT /messages/id (update)DELETE /messages/id (delete)var express = require('express'),
mongoose = require('mongoose'),
Schema = mongoose.Schema;
var app = express();
// Set mongoose connection to app.db
app.db = mongoose.connect('mongodb://localhost/test');
// Initialize services
var services = require('mongo-services')(app);
var messageSchema = new Schema({
text: {type: String, required: true}
});
// Add service with name and schema
services.add('messages', messageSchema);
// Consider keeping schemas in a separate folder for organization
services.add('users', require('./models/user.model.js'));
// Access services for anywhere using app.service()
app.service('messages').create({text: "hi"}, function(err, message) {
if (!err) console.log(message);
});
// If you want, set up REST endpoints for services
services.configureREST();
// Start!
app.listen(5000);
console.log('Howdy! There\'s a server running at http://localhost:5000');
mongo-services does not (yet) support:
FAQs
Creates services using a provided model and mongoose connection, and exposes them via RESTful API.
The npm package mongo-services receives a total of 4 weekly downloads. As such, mongo-services popularity was classified as not popular.
We found that mongo-services demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.