openaq/openaq-upload Batch uploader for OpenAQ by @openaq – Repository

A page used to upload CSV data to the OpenAQ project, which checks the data against rules in a JSON schema and delivers helpful error messages in cases of nonconformance.

Development environment

To set up the development environment for this website, you’ll need to install the following on your system:

  • Node (v4.2.x) & Npm (nvm usage is advised)

The versions mentioned are the ones used during development. It could work with newer ones.

After these basic requirements are met, run the following commands in the website’s folder:

$ npm install

Development environment (server)

This site depends on the server to acquire credentials for uploading to S3. In production, this server will
be hosted by the OpenAQ maintainers, but a development server can be launched locally from the server
directory of this project. After running npm install in the server directory, the server can be launched
using the command env S3_ACCESS_KEY=xxx S3_SECRET_KEY=xxx S3_BUCKET=xxx S3_REGION=xxx node server.js, with
the credentials to the desired S3 bucket. The bucket will need to have a CORS policy permissive of uploads from
localhost. The server launches on port 5000, which is used in this development version of the upload form.

Getting started

$ npm run serve

Compiles the sass files, javascript, and launches the server making the site available at http://localhost:3000/
The system will watch files and execute tasks whenever one of them changes.
The site will automatically refresh since it is bundled with livereload.

★ READ ALSO ★  ★ Displaying sites that are down on a dashboard using Oh Dear! webhooks

Other commands

Compile the sass files, javascript… Use this instead of npm run serve if you don’t want to watch.

$ npm run build

Source link

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.