Skip to content

Sustainability and environmental awareness on the Internet. Experimental release.

License

Notifications You must be signed in to change notification settings

metatarz/sustainable

Repository files navigation

Digital Sustainability Audits - server example

Introduction

This is an example of running DAS in a full server solution. It uses BullMQ for queueing jobs, Puppeteer-Cluster for creating a cluster of puppeteer worers and a NodeJS Express server.

Instructions to run locally

Using docker-compose (recommended): 1. Git clone the master branch
2. Run `docker-compose up -d`
  • Audit any URL with a POST request at localhost/service/add including a JSON body param url containing the corresponding URL to audit.
curl -d "url=https://www.example.org" http://localhost/service/add
Normal installation steps: 1. Git clone the master branch
2. If you don't have already, install `yarn` globally with: `npm i -g yarn`
3. Run `yarn` on the local folder
4. Redis is needed. Download the library [from source](https://redis.io/topics/quickstart) or docker it. Make sure it is running on the port number 6379
5. Run the script `yarn dev`, which will launch the server listening at localhost:7200
  • Audit any URL with a POST request at /service/add including a JSON body param url containing the corresponding URL to audit.
curl -d "url=https://www.example.org" http://localhost:7200/service/add

Feel free to change the configuration at /src/config to suit your needs.

About

Sustainability and environmental awareness on the Internet. Experimental release.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published