API server built with Express (Nodejs). Created to facilitate user interactions between a PostgreSQL database and a React frontend.
Part of Anthology, a project that enables user access to communal databases with the intent of having easily retrievable excerpts of books, poems, lyrics, and information.
- Setup PostgreSQL server on host machine.
- Run SQL script found at
db/lit_db.sql
to setup tables in the database.
- Clone this repository
- cd to root directory of project in a terminal
- Create a file named
.env
in this project's root directory. Occupy with the following environment variables relating to the Postgres database:
PGHOST=<host machine name>
PGUSER=<postgres username>
PGDATABASE=<database name>
PGPASSWORD=<postgres password>
PGPORT=<port number for postgres server>
- Call
npm install
to installnode_modules
- For a development server, call
npm run dev
. To run the server, callnpm start