Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 1.06 KB

README.md

File metadata and controls

28 lines (15 loc) · 1.06 KB

Getting started with PostgreSQL

How to send data from Node.js to PostgreSQL

You can find here some examples of Node.js code to send data to a PostgreSQL server.

These examples are designed to run with a Stackhero PostgreSQL service. You'll more informations about Stackhero here:

How to use

This example will connect to your PostgreSQL server, create the database stackherotest and the table users and fill it with 100 fake users datas.

  1. Clone this repository: git clone https://github.com/stackhero-io/postgresqlGettingStarted && cd postgresqlGettingStarted

  2. Copy the file .env-example to .env and fill it with your credentials.

  3. Install dependencies: npm install.

  4. Run the script: npm run start.

You can see the script code in the file app.js and see how it works to use it as an example.