pa11y-webservice provides scheduled accessibility reports for multiple URLs
pa11y-webservice provides scheduled accessibility reports for multiple URLs. It runs pa11y on a list of URLs, which you can update and query the results of via a JSON web-service.
You'll then need to clone this repo locally and install dependencies with
npm install. Once you have a local clone, you'll need to copy some sample configuration files in order to run the application. From within the repo, run the following commands:
cp config/development.sample.json config/development.jsoncp config/production.sample.json config/production.jsoncp config/test.sample.json config/test.json
Each of these files defines configurations for a different environment. If you're just running the application locally, then you should be OK with just development and test configurations. The available configurations are documented here.
Now that you've got your application configured, you can run in each mode with the following commands:
NODE_ENV=production node index.js # Run in productionNODE_ENV=development node index.js # Run in developmentNODE_ENV=test node index.js # Run in test
See development instructions for more information about running locally (and restarting automatically when files change).
The web-service which pa11y-webservice exposes is documented in the wiki:
The boot configurations for pa11y-webservice are as follows. Look at the sample JSON files in the repo for example usage.
(string) The mongodb connection string for your database.
(string) The host to run the application on. This is normally best left as
"0.0.0.0" – which means the application will run on any incoming connections.
(number) The port to run the application on.
(string) A crontab which describes when to generate reports for each task in the application.
To develop pa11y-webservice, you'll need to clone the repo and get set up as outlined in the setup guide.
You'll need to start the application in test mode with:
NODE_ENV=test node index.js
Now you'll be able to run the following commands:
make # Run the lint and test tasks togethermake lint # Run linters with the correct configmake test # Run integration tests
Code with lint errors or failing tests will not be accepted, please use the build tools outlined above.
For demoing pa11y-webservice, you can insert some example tasks and results by running one of the following commands (depending on your environment):
NODE_ENV=development make fixturesNODE_ENV=test make fixtures