express-cool-api

    1.0.1 • Public • Published

    express-cool-api

    Build a "cool" API by being less restrictive on your JSON validation.

    Installation

    npm install express-cool-api
    

    Usage

    var cool = require('express-cool-api');
     
    app.post('/api/articles', cool.sanitize(schemaSanitization), cool.validate(schemaValidation), function (req, res) {
        // Get req.hash with a perfect JSON as you expected
        console.log(req.hash);
    });

    API

    // Transform the given json as a cool hash
    cool.sanitize(schema);
    // Aliases: cool.s(schema), cool.sanitization(schema)
    
    // Validate the given json to respect your standards
    cool.sanitize(schema);
    // Aliases: cool.s(schema), cool.sanitization(schema)
    

    Sanitization and Validation Documentation

    https://github.com/Atinux/schema-inspector

    Install

    npm i express-cool-api

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • atinux