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 - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

src/example/settings.ts

2

package.json
{
"name": "express-joi-simple",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -44,2 +44,25 @@ # Express + Joi + Swagger

Use require instead of import for plain Javascript.
More complicated example you can find in example folder.
More complicated example you can find in example folder.
## Swagger documentation settings example:
```
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: '/'
}
```
Doc(app, settings);

@@ -7,5 +7,7 @@

export function Doc(app: any, info?: any) {
Swagger.swaggerDoc.createJsonDoc(info);
export function Doc(app: any, settings?: any) {
const {info, host, basePath} = settings;
Swagger.swaggerDoc.createJsonDoc(info, host, basePath);
app._router.stack.forEach((middleware: any) => {

@@ -12,0 +14,0 @@ if (middleware.route) { // routes registered directly on the app

@@ -6,2 +6,3 @@ import * as express from 'express';

import { Doc, Validate, RequestHandler } from '../index';
import { settings } from './settings';

@@ -30,3 +31,3 @@ const app = express();

app.listen(3000, () => {
Doc(app);
Doc(app, settings);
})
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