Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-joi-simple

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-joi-simple

## Installation

  • 1.0.2
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Express + Joi + Swagger

Everything automated and easy to setup

Support Javascript/Typescript

===

Installation

npm i express-joi-simple --save

Example

import * as express from 'express';
import { router } from './router';
import * as joi from 'joi';
import { Doc, Validate } from 'express-joi-simple';

const app = express();

const schema = {
    body: {
        test1: joi.string().required()
    }
}

// Note middleware here
app.post('register',Validate(schema), (req: any, res: any) => {
    res.json({
        message: 'register'
    })
})

// Router will only work if this PR is accepted: https://github.com/expressjs/express/pull/3713#issuecomment-412275954
app.use('/login', router);

app.listen(3000, () => {
    // Note function Doc here
    Doc(app);
})

Use require instead of import for plain Javascript.

Keywords

FAQs

Package last updated on 11 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc