a simple blood bank API.For learning Goals.
a simple blood bank API. It does not have any HTML or CSS. Just nodejs and SQL.
The data in our API is:
Patients: name, id, blood group Donors: name, id, blood group, contact number, blood bank Blood bank: name, city, contact number, list of donors. endpoints available will be:
/donors with get and post methods. /patients with get and post methods /blood-banks with get and post methods.
I wrote 1 test for each endpoint.
- clone this Repo
- npm init - y
- npm i
- Create your local database through these commands at the terminal
CREATE DATABASE (name of database);
CREATE USER (name of the user) WITH SUPERUSER PASSWORD (put password);
GRANT ALL PRIVILEGES ON DATABASE <database name here> TO <desired username entered previously>;
- Create .env file and add the DATABASE_URL
- npm start for localhost
- npm run test