All Projects → diegohaz → bodymen

diegohaz / bodymen

Licence: other
Body parser middleware for MongoDB, Express and Nodejs (MEN)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bodymen

peerai-api
Peerism's Peer.ai API built with Truffle, Node.js, Express.js, Solidity, and Ethereum TestRPC
Stars: ✭ 18 (-63.27%)
Mutual labels:  mongoose, express-middleware
querymen
Querystring parser middleware for MongoDB, Express and Nodejs (MEN)
Stars: ✭ 128 (+161.22%)
Mutual labels:  mongoose, express-middleware
Phantom
A mimic website of Pinterest where one can share ideas , socialize and find inspirational ideas
Stars: ✭ 18 (-63.27%)
Mutual labels:  mongoose
nodejs grpc
GRPC based API CRUD using Nodejs at both server and client side
Stars: ✭ 17 (-65.31%)
Mutual labels:  mongoose
quickmongo
Quick mongodb wrapper for beginners that provides key-value based interface.
Stars: ✭ 73 (+48.98%)
Mutual labels:  mongoose
mongoose-keywords
Mongoose plugin that generates a keywords path combining other paths values
Stars: ✭ 23 (-53.06%)
Mutual labels:  mongoose
node-mongodb-graphql-starter
A boilerplate for Node.js, MongoDB & GraphQL applications.
Stars: ✭ 56 (+14.29%)
Mutual labels:  mongoose
zuly
🤖 | Hi, I'm zuly, a brazilian bot! Focused on animes!
Stars: ✭ 45 (-8.16%)
Mutual labels:  mongoose
nodejs-starter-template
You can use this template when you're starting a new project by using Node.js, Express, and Mongoose. It contains general concepts, you can customize it according to your needs.
Stars: ✭ 54 (+10.2%)
Mutual labels:  mongoose
sinon-mongoose
Extend Sinon stubs for Mongoose methods to test chained methods easily
Stars: ✭ 87 (+77.55%)
Mutual labels:  mongoose
milliparsec
🌌 Tiniest body parser in the universe. Built for modern Node.js
Stars: ✭ 116 (+136.73%)
Mutual labels:  body-parser
MERN-JWT-AND-ROLE-AUTH
Neccessary features needed for your mern Application are now available.
Stars: ✭ 30 (-38.78%)
Mutual labels:  mongoose
Snippet2
A simple Code Snippet with user account and share feature
Stars: ✭ 20 (-59.18%)
Mutual labels:  mongoose
Project09-C-Uber-Clone
WOOBER 🚓🌱 지도 컴포넌트를 활용한 Uber 서비스 클론
Stars: ✭ 18 (-63.27%)
Mutual labels:  mongoose
nodeJS examples
Server, routing, db examples using NodeJS v6
Stars: ✭ 34 (-30.61%)
Mutual labels:  mongoose
Express-REST-API-Generator
Express REST API Generator is an Express Based API skeleton. A template for starting projects with express as an API. This project can be used for creating a RESTful API using Node JS, Express as the framework, Mongoose to interact with a MongoDB instance and Sequelize for support of SQL compatible databases. Mocha is also used for running unit …
Stars: ✭ 100 (+104.08%)
Mutual labels:  mongoose
remult
A CRUD framework for full stack TypeScript
Stars: ✭ 1,488 (+2936.73%)
Mutual labels:  express-middleware
nodejs-shopping-cart
NodeJS / Express / MongoDB - Shopping Cart (monolithic app with handlebars)
Stars: ✭ 42 (-14.29%)
Mutual labels:  mongoose
NodeScalableArchitecture
A Scalable Node Architecture/Server. This repository contains a complete implementation of writing scalable nodejs server/architecture on my medium blog.
Stars: ✭ 62 (+26.53%)
Mutual labels:  mongoose
idpt
Internet-Delivered Psychological Therapy (IDPT) System.
Stars: ✭ 24 (-51.02%)
Mutual labels:  mongoose

bodymen

NPM version Build Status Coveralls Status Dependency Status Downloads

Bodymen works similarly to Querymen and has almost the same functionality, expect it formats, validates and parses request body instead of querystrings. Refer to Querymen's readme to find out more.

Prerequisites

You must use a request body parser like express body-parser and set it up before using bodymen:

import express from 'express'
import bodyParser from 'body-parser'

const app = express()

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

Install

npm install --save bodymen

Usage

Bodymen allows you to define a schema to control the fields sent through the request body.

import bodymen, { errorHandler } from "bodymen"

app.post('/posts', bodymen.middleware({
  title: {
    type: String,
    required: true,
    trim: true,
    minlength: 3
  },
  content: {
    type: String,
    required: true,
    minlength: 32
  },
  tags: [String]
}), (req, res) => {
  console.log(req.bodymen.body) // will contain the parsed body
})

app.use(errorHandler()) // will send standard error messages, similar to Querymen

License

MIT © Diego Haz

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].