Comparing version 1.1.3 to 1.1.4
@@ -46,3 +46,3 @@ import express, { NextFunction, Request } from 'express'; | ||
* @param {Request} req - The HTTP request object. | ||
* @param {any} res - The HTTP response object. | ||
* @param {Response} res - The HTTP response object. | ||
* @param {NextFunction} next - The next middleware function. | ||
@@ -49,0 +49,0 @@ */ |
{ | ||
"name": "outport", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"main": "dist/index.js", | ||
@@ -14,3 +14,3 @@ "types": "dist/index.d.ts", | ||
"create-cjs-file": "npx rollup dist/index.js --file dist/index.cjs --format cjs --external express,path,url", | ||
"build": "tsc && npm run create-cjs-file && npm run copy-files", | ||
"build": "tsc --declaration --emitDeclarationOnly && npm run create-cjs-file && npm run copy-files", | ||
"prepublishOnly": "npm run build" | ||
@@ -17,0 +17,0 @@ }, |
# Outport | ||
Outport is an API testing and documentation library that helps you document, test, and visualize your API endpoints. It provides an organized interface to define your API endpoints and displays them in a user-friendly format for ease of use and debugging. | ||
Outport is a versatile library for API testing and documentation, offering a user-friendly interface to define, test, and visualize API endpoints for seamless debugging and collaboration. | ||
## Demo | ||
@@ -10,14 +9,11 @@ | ||
## Features | ||
- Easily document API endpoints | ||
- Auto-generate API documentation with a clean interface | ||
- Debugging support for API endpoints with detailed request information | ||
- Define headers, parameters, body, and responses for API routes | ||
- Simple setup and usage in an Express environment | ||
- Supports multiple servers and environments | ||
- Easily document API endpoints. | ||
- Auto-generate API documentation with a clean interface. | ||
- Debugging support for API endpoints with detailed request information. | ||
- Define headers, parameters, body, and responses for API routes. | ||
- Simple setup and usage in an Express environment. | ||
- Supports multiple servers and environments. | ||
Here’s the updated installation and usage guide: | ||
--- | ||
@@ -32,2 +28,3 @@ | ||
``` | ||
--- | ||
@@ -38,5 +35,5 @@ ## Usage | ||
### 1. Import Outport and Configure It | ||
### 1. Import and Configure Outport | ||
Import **Outport** and initialize it with your configuration. Here’s an example setup in an Express app: | ||
Import **Outport** and initialize it with your configuration in an Express app: | ||
@@ -48,3 +45,3 @@ ```javascript | ||
title: 'User Management APIs', | ||
version: '1.0.0', | ||
version: '1.1.4', | ||
servers: [ | ||
@@ -62,3 +59,3 @@ 'https://outport-demo-production.up.railway.app', | ||
], | ||
description: `Outport is an API testing and documentation library that helps you document, test, and visualize your API endpoints in a user-friendly interface.`, | ||
description: `Outport is a versatile library for API testing and documentation, offering a user-friendly interface to define, test, and visualize API endpoints for seamless debugging and collaboration.`, | ||
}); | ||
@@ -136,2 +133,3 @@ ``` | ||
``` | ||
### 4. Accessing the Documentation | ||
@@ -141,2 +139,4 @@ | ||
--- | ||
## Scripts | ||
@@ -147,2 +147,4 @@ | ||
--- | ||
## Development Dependencies | ||
@@ -156,4 +158,27 @@ | ||
--- | ||
## Peer Dependencies | ||
- **Express**: Works with both Express 4 and the upcoming Express 5 beta releases. | ||
--- | ||
## Contributors | ||
- **Mirza Shahzaib** ([GitHub](https://github.com/GMShahzaib)) | ||
Email: gms.shahzaib@gmail.com | ||
--- | ||
## License | ||
This project is licensed under the ISC License. | ||
--- | ||
## Repository | ||
Find the source code and contribute at [GitHub](https://github.com/GMShahzaib/outport). | ||
--- |
@@ -1,2 +0,2 @@ | ||
import express, { NextFunction, Request } from 'express'; | ||
import express, { NextFunction, Request, Response } from 'express'; | ||
import { APIDocumentation, Endpoint } from './schema.js'; | ||
@@ -180,11 +180,9 @@ import { fileURLToPath } from 'url'; | ||
* @param {Request} req - The HTTP request object. | ||
* @param {any} res - The HTTP response object. | ||
* @param {Response} res - The HTTP response object. | ||
* @param {NextFunction} next - The next middleware function. | ||
*/ | ||
private swaggerInitFn(req: Request, res: any, next: NextFunction) { | ||
private swaggerInitFn(req: Request, res: Response, next: NextFunction) { | ||
const url = req.url && req.url.split('?')[0]; | ||
if (url.endsWith('/absolute-path.js')) { | ||
res.sendStatus(404); | ||
} else if (url.endsWith('/outport-des-init.js')) { | ||
if (url.endsWith('/outport-des-init.js')) { | ||
res.set('Content-Type', 'application/javascript'); | ||
@@ -191,0 +189,0 @@ res.send(this.outportTPLString.replace('<% apiOptions %>', this.stringify({ apis: this.apis, values: this.values }))); |
@@ -12,2 +12,4 @@ { | ||
"declaration": true, | ||
"declarationDir": "./dist", | ||
"moduleResolution": "node", | ||
"typeRoots": [ | ||
@@ -14,0 +16,0 @@ "./node_modules/@types" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220208
175