Simple database connection

Deploy simple code

  1. To clone the repository from GitHub, you can use the following command:
    git clone https://github.com/hiepnguyendt/sample-database-connection.git
    

simplecode

  1. Eit file .env with your database credential
    nano .env
    

simplecode

  • DB_USER: ‘your username’
  • DB_PASS: ‘your password’
  • DB_HOST: ’endpoint your RDS PostgreSQL'
  • DB_PORT: ‘5432’

simplecode

  1. Run the code:
    npm start
    

simplecode

Now, you are connecting to RDS PostgreSQL with:

  • User: masteruser
  • Database: pglab
  • Port: 5432