Skip to main content

@reapit-cdk/edge-api-swagger

npm version npm downloads coverage: 0%25 Integ Tests: X

Add a swagger endpoint to your EdgeAPI

Package Installation:

yarn add --dev @reapit-cdk/edge-api-swagger
# or
npm install @reapit-cdk/edge-api-swagger --save-dev

Usage

import { Stack, App } from 'aws-cdk-lib'
import { EdgeAPI, EdgeAPILambda, LambdaEndpoint, ProxyEndpoint } from '@reapit-cdk/edge-api'
import { Code, Runtime } from 'aws-cdk-lib/aws-lambda'
import { EdgeAPISwaggerEndpoint } from '@reapit-cdk/edge-api-swagger'
import { Certificate } from 'aws-cdk-lib/aws-certificatemanager'
import * as path from 'path'

const app = new App()
const stack = new Stack(app, 'stack-name')

const certificate = new Certificate(stack, 'certificate', {
  domainName: 'example.org',
})
const api = new EdgeAPI(stack, 'api', {
  certificate,
  domains: ['example.org', 'example.com'],
  devMode: false,
  defaultEndpoint: new ProxyEndpoint({
    destination: 'example.com',
    pathPattern: '/*',
  }),
})

const lambdaFunction = new EdgeAPILambda(stack, 'lambda', {
  code: Code.fromAsset(path.resolve('../lambda/dist')),
  codePath: path.resolve('../lambda/src/index.ts'), // gets added to the docs
  handler: 'index.handler',
  runtime: Runtime.NODEJS_18_X,
  environment: {
    aVariable: 'contents',
  },
})

api.addEndpoint(
  new LambdaEndpoint({
    pathPattern: '/api/lambda',
    lambdaFunction,
  }),
)

api.addEndpoint(
  new EdgeAPISwaggerEndpoint(stack, 'docs', {
    api,
    url: 'https://example.org',

    pathPattern: '/swagger', // optional, defaults to /swagger

    // optional
    info: {
      title: '', // defaults to Edge API
      version: '', // defaults to 1.0.0
    },
  }),
)

Metadata

Release files for reapit-cdk.edge-api-swapper 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reapit-cdk.edge-api-swapper 0.1.5
File Size Uploaded Provenance Actions
reapit-cdk.edge-api-swapper-0.1.5.tar.gz 134.2 kB Without provenance Details for reapit-cdk.edge-api-swapper-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reapit-cdk.edge-api-swapper 0.1.5
File Interpreter ABI Platform Actions
reapit_cdk.edge_api_swapper-0.1.5-py3-none-any.whl Python 3 none any Details for reapit_cdk.edge_api_swapper-0.1.5-py3-none-any.whl

Total release size: 267.1 kB

Release files / reapit-cdk.edge-api-swapper-0.1.5.tar.gz

Download URL reapit-cdk.edge-api-swapper-0.1.5.tar.gz
Size 134.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f93bf46c7ba0cc9e272b6ada2aa8f3ad87be961b13868ee45e0ab0e07d086547
BLAKE2b-256 checksum
How to use checksums
857aaf17156e71319b1ee7fa7b43cbc1d2edd2f9a9af35cc7e4b0d6574c41694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / reapit_cdk.edge_api_swapper-0.1.5-py3-none-any.whl

Download URL reapit_cdk.edge_api_swapper-0.1.5-py3-none-any.whl
Size 132.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95103270644d854d99b8c400032fec24070a513d40ddc55b92e9ea75dd59fc71
BLAKE2b-256 checksum
How to use checksums
beff48e157a82442ed457c6e952f5c8106ab952077a21fff9e3e6c36070a693d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Security for reapit-cdk.edge-api-swapper 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page