Giter Site home page Giter Site logo

nodejs-demo-postgres's Introduction

Instructions

  • Get connected to the database using PSQL command(Postgres-client)
  • Let's create a sample database
    • create database demo;
  • Switch to the demo database
    • \c demo;
  • Create a table in the database which we created
create table employee(
id SERIAL,
name varchar(50),
job varchar(40),
department varchar(40),
salary int,
hire_date date,
PRIMARY KEY (id));
  • Exit out of that database
    • \q
  • Now we are back on the VM, let's install NodeJs and NPM
    • apt-get install nodejs npm
  • Let's clone the code from repository
  • We need to update the connection string in the employee.js
    • vi routes/employees.js
  • Install the node libraries
    • npm install
  • You need to allow the traffic on port 80 of this VM, as this application runs on that port only.
  • Let's run the application
    • node app.js
  • Now, browse your application in browser at http://vm_ip:80

nodejs-demo-postgres's People

Contributors

thechetantalwar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.