Skip to content

Antyfive/teo-body-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teo-body-parser

Teo.JS body parser middleware based on Express.js body-parser module.

This module provides support for all of the wrapped API:

Teo.JS Config Example

module.exports = {
    protocol: "http",
    host: "localhost",
    port: 3100,
    cluster: {
        enabled: true
    },
    extensions: [
        {
            name: "body-parser",
            module: "teo-body-parser",
            config: {
               // enables all parsers with the default options
               json: true,
               urlencoded: true,
               raw: true,
               text: true
            }
        }
    ],
};

When passing json: true - no options will be passed, and the parser will be enabled with the default options as bodyParser.json().

Alternatively, if you want to pass the additional configuration options for some specific parser, just replace true with your configuration object. E.g.

extensions: [
    {
        name: "body-parser",
        module: "teo-body-parser",
        config: {
           json: true,
           // will apply bodyParser.urlencoded({extended: true})
           urlencoded: { extended: true },
           raw: true,
           text: true
        }
    }
],

Releases

No releases published

Packages

No packages published