/Freecycle-API

Freecycle scraper and API written in Node.js

Primary LanguageJavaScript

Freecycle-API

Scrapes Freecycle groups and creates API from data. Scraper based off Hughjmp's work.

Install

1. Set Up Database

Create a new database (Recommended: https://mlab.com) with a collection called 'posts' and set MONGODB_URL as the database url provided in Freecycle-API/app/.env.example. Then rename .env.example to .env.

2. Install Dependencies

$ cd Freecycle-API/
$ npm install

Start Server

Development

cd Freecycle-API/
npm run dev

Production

$ cd Freecycle-API/app/
$ npm run start

Deploy

The API uses Zeit Now.

1. Install Now

$ npm install -g now

2. Set Environment variables

For each environment variable execute the following. This only needs to be done once.

$ now secrets add mongodb-url "<MONGODB_URL>"
$ now -e MONGODB_URL=@mongodb-url

3. Deploy

$ cd Freecycle-API/
$ npm run deploy