yarn install
-
Install PostgreSQL
sudo apt-get install postgresql
-
Change the default user password
sudo passwd postgres
-
Change the Postgres admin password
# Change to the postgres user su - postgres # Log in to the postgres prompt psql # Change password \password postgres
-
Create database
# (In postgres prompt) CREATE DATABASE files;
-
Run script to create table 'files'
DATABASE_URL='postgres://postgres:<YOURPASSWORD>@localhost:5432/files' node models/files.js
where is a password you typed in step 3
Use webpack-dev-server with hot reload, source maps and dev React version
yarn dev
yarn build
Server serves built files from /dist, so you need to run yarn build
first.
PGUSER=postgres PGHOST=localhost PGPASSWORD=pgpass PGDATABASE=files PGPORT=5432 node index.js