
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
express-joi-simple
Advanced tools
npm i express-joi-simple --save
import * as express from 'express';
import * as joi from 'joi';
import * as BodyParser from 'body-parser';
import { Doc, Validate, RequestHandler } from 'express-joi-simple';
const app = express();
app.use(BodyParser.json());
const schema = {
body: {
test1: joi.string().required()
},
model: 'Register'
}
// Note middleware here
app.post('register', Validate(schema), (req: any, res: any) => {
res.json({
message: 'register'
})
})
app.use(RequestHandler);
app.listen(3000, () => {
// Note function Doc here
Doc(app);
})
Use require instead of import for plain Javascript. More complicated example you can find in example folder.
const settings = {
info: {
"version": "1.0.0",
"title": "Title Example",
"description": "Description API example",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Example team"
},
"license": {
"name": "MIT"
}
},
host: 'localhost:3000',
basePath: '/',
documentaionPath: /doc
}
Doc(app, settings);
Default documentation path is: /
So you can find documentation: localhost:3000/
FAQs
## Installation
The npm package express-joi-simple receives a total of 2 weekly downloads. As such, express-joi-simple popularity was classified as not popular.
We found that express-joi-simple demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.