Let's make sure our Express app has the required base modules:
# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
var express = require('express'), | |
passport = require('passport'), | |
TwitterStrategy = require('passport-twitter').Strategy, | |
ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn, | |
app = express(); | |
app.use(express.static(__dirname + '/public')); | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: 'keyboard cat' })); | |
app.use(passport.initialize()); |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)