Code Monkey home page Code Monkey logo

koa-legit's Introduction

Koa Legit

Koa Legit

๐Ÿšฅ Koa middleware to validate and sanitize HTTP request


Koa Legit is a Koa middleware to easily validate HTTP request data including headers, cookies, body, query strings, and url params. It's based on validator.

  • It was written for us on OMNIOUS which provides fashion A.I API service.

Installation

# NPM
$ npm install --save koa-legit
# Yarn
$ yarn add koa-legit

Example

const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const legit = require('koa-legit');
const Router = require('koa-router');


const app = new Koa();

// Set middlewares
app.use(bodyParser({ enableTypes: ['json', 'form'] }));
app.use(legit());


// Bootstrap application router
const router = new Roter();
app.use(router.routes());
app.use(router.allowedMethods());

app.listen(3000);

API

To be updated

Contributing

This project follows the Contributor Covenant Code of Conduct.

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or ask feature requests.

Self Promotion

Like koa-legit? Follow the repository on GitHub. And if you're feeling especially charitable, follow posquit0 on GitHub.

Contact

If you have any questions, feel free to join me at #posquit0 on Freenode and ask away. Click here to connect.

License

Provided under the terms of the MIT License.

Copyright ยฉ 2017, Byungjin Park.

koa-legit's People

Contributors

posquit0 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.