Comparing version 1.0.9 to 1.1.0
{ | ||
"name": "outport", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
121
README.md
@@ -20,2 +20,6 @@ # Outport | ||
Here’s the updated installation and usage guide: | ||
--- | ||
## Installation | ||
@@ -31,7 +35,7 @@ | ||
To use **Outport** in your project, follow the steps below: | ||
To use **Outport** in your project, follow these steps: | ||
### 1. Import Outport and Configure It | ||
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. Here’s an example setup in an Express app: | ||
@@ -45,3 +49,4 @@ ```javascript | ||
servers: [ | ||
'http://localhost:8081', | ||
'https://outport-demo-production.up.railway.app', | ||
'http://localhost:8080', | ||
'https://api.example.com/v1' | ||
@@ -51,9 +56,4 @@ ], | ||
{ | ||
key: "x-api-key", | ||
value: "YOUR_API_KEY_HERE", | ||
description: "API key required to authenticate requests" | ||
}, | ||
{ | ||
key: "x-globe-header", | ||
value: "AJFLJL23J43908F09A8SD09", | ||
key: "Authorization", | ||
value: "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | ||
description: "Used for global session identification across requests" | ||
@@ -68,61 +68,57 @@ } | ||
Define API endpoints using the `outport.use()` method. Here’s an example defining GET and POST routes: | ||
Define your API endpoints using the `outport.use()` method. Here’s an example with routes for `Authentication` and `Users`: | ||
```javascript | ||
outport.use("API Examples", [ | ||
outport.use("Authentication", [ | ||
{ | ||
"path": "/test-get", | ||
"method": "GET", | ||
"summary": "Fetches example data.", | ||
"headers": [ | ||
{ "key": "header1", "value": "50", "description": "Example header" }, | ||
{ "key": "header2", "value": "50", "description": "Another example header" } | ||
], | ||
"parameters": [ | ||
{ "key": "param1", "value": "50", "description": "Example parameter", "required": false }, | ||
{ "key": "param2", "value": "50", "description": "Another parameter", "required": false }, | ||
{ "key": "param3", "value": "50", "description": "Third parameter", "required": false } | ||
], | ||
"responses": [ | ||
path: "/login", | ||
method: "POST", | ||
summary: "Authenticate user and return token.", | ||
body: { | ||
type: "json", | ||
data: [ | ||
{ key: "username", value: "johndoe" }, | ||
{ key: "email", value: "johndoe@example.com" }, | ||
{ key: "password", value: "testing123!" } | ||
] | ||
}, | ||
responses: [ | ||
{ | ||
"status": 200, | ||
"description": "Example Response:", | ||
"value": { | ||
"success": true, | ||
"params": { | ||
"param1": "50", | ||
"param2": "50", | ||
"param3": "50" | ||
}, | ||
"message": "success" | ||
}, | ||
"headers": [ | ||
{ "key": "access-control-allow-origin", "value": "*" }, | ||
{ "key": "content-length", "value": "89" }, | ||
{ "key": "content-type", "value": "application/json; charset=utf-8" }, | ||
{ "key": "date", "value": "Mon, 11 Nov 2024 12:15:38 GMT" }, | ||
{ "key": "etag", "value": "W/\"59-MUxpGl4+hXme7ole0kweVCoQ93Y\"" }, | ||
{ "key": "x-powered-by", "value": "Express" } | ||
] | ||
status: 200, | ||
description: "Login successful.", | ||
value: { | ||
message: "Login successful", | ||
user: { | ||
id: 1, | ||
username: "johndoe", | ||
email: "johndoe@example.com", | ||
token: "abc123xyz" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
} | ||
]); | ||
outport.use("Users", [ | ||
{ | ||
"path": '/test-post', | ||
"method": 'POST', | ||
"summary": "Submit a test post.", | ||
"body": { | ||
"type": "form", | ||
"data": [ | ||
{ "key": "name", "value": 50, "type": 'text' }, | ||
{ "key": "profile", "type": 'file' }, | ||
{ "key": "address", "type": 'text' } | ||
] | ||
}, | ||
"parameters": [ | ||
{ "key": "hello", "value": "50", "description": "Description here", "required": false }, | ||
{ "key": "hello2", "value": "50", "description": "Second description", "required": false } | ||
path: "/users", | ||
method: "GET", | ||
summary: "Fetch a list of users.", | ||
parameters: [ | ||
{ key: "page", value: "1", description: "Page number" }, | ||
{ key: "limit", value: "10", description: "Items per page" } | ||
], | ||
"responses": [ | ||
{ "status": 200, "description": "This is my test description." } | ||
responses: [ | ||
{ | ||
status: 200, | ||
description: "List of users.", | ||
value: { | ||
message: "Fetched all users successfully", | ||
users: [ | ||
{ id: 1, username: "johndoe", email: "johndoe@example.com" }, | ||
{ id: 2, username: "janedoe", email: "janedoe@example.com" } | ||
] | ||
} | ||
} | ||
] | ||
@@ -135,3 +131,3 @@ } | ||
Serve the **Outport** documentation in your Express app: | ||
Integrate Outport’s documentation in your Express app by adding: | ||
@@ -141,3 +137,2 @@ ```javascript | ||
``` | ||
### 4. Accessing the Documentation | ||
@@ -144,0 +139,0 @@ |
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
214925
151