Getting ready

We'll need to install a Postgres server.

On Mac OS, we can use Homebrew (http://brew.sh):

$ brew install postgres 

For Windows systems, we can download a GUI installer from https://www.postgresql.org/download/windows/.

For Linux systems, we can obtain an appropriate package from https://www.postgresql.org/download/linux/.

Once installed (and started) we'll want to create a database named after our system username.

After installation, in the usual command terminal, run the following:

$ createdb `whoami`

Once we have Postgres up and running, let's create a folder called postgres-app with an index.js file.

Then, we'll initialize the folder with a package.json file and grab the pg module, which is a pure JavaScript module (as opposed to a C++ binding to the Postgres C driver):

$ npm init -y 
$ npm install --save pg
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset