The idea behind this project is to connect individuals who are looking to get their blood donated. The result is a simple in-browser app that pushes user's entries into a SQL database.
Clone the project
git clone [email protected]:carlosblanc0/donatefy.git
Go to the project directory
cd donatefy
Install dependencies
npm install
Spin up the database (I've used ElephantSQL's free tier for demoing purposes)
touch elephantsql.js
var pg = require('pg');
var conString = "INSERT_YOUR_POSTGRES_URL_HERE" //Can be found in the Details page
var client = new pg.Client(conString);
client.connect(function(err) {
if(err) {
return console.error('could not connect to postgres', err);
}
client.query('SELECT NOW() AS "theTime"', function(err, result) {
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].theTime);
client.end();
});
});
Start the server
npm start
Coming soon on https://donatefy.herokuapp.com