Skip to content

AFixt/waveproxy

Repository files navigation

WAVE API Proxy

A serverless proxy for the WAVE API that manages the API key and forwards requests to the WAVE accessibility evaluation service.

Features

  • Validates requests before forwarding to WAVE API
  • Manages the API key securely
  • Supports all WAVE API parameters
  • Deployable to AWS Lambda

Getting Started

Prerequisites

  • Node.js 18+
  • npm
  • AWS account (for deployment)

Installation

  1. Clone this repository
  2. Install dependencies:
npm install
  1. Create a .env file based on .env.example:
cp .env.example .env
  1. Add your WAVE API key to the .env file:
WAVE_API_KEY=your_wave_api_key_here

Running Locally

npm start

The server will start at http://localhost:3000 with the WAVE API proxy endpoint available at http://localhost:3000/api/wave.

API Usage

Wave API Proxy Endpoint

POST /api/wave

Request Parameters

Parameter Type Required Description
url string Yes The URL to evaluate
reporttype number No 1 for summary, 2 for detailed (default: 1)
format string No 'json' or 'html' (default: 'json')

Example Request

{
  "url": "https://example.com",
  "reporttype": 1,
  "format": "json"
}

Development

# Run in development mode with hot reloading
npm run dev

# Run tests
npm test

# Run linting
npm run lint

# Run type checking
npm run typecheck

# Build for production
npm run build

Deployment to AWS

  1. Configure your AWS credentials:
aws configure
  1. Deploy to AWS:
npm run deploy

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published