https://github.com/blevs/webdb-postgres
https://github.com/blevs/webdb-postgres
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/blevs/webdb-postgres
- Owner: Blevs
- Created: 2019-09-16T17:48:11.000Z (almost 7 years ago)
- Default Branch: recitation
- Last Pushed: 2023-01-11T01:30:47.000Z (over 3 years ago)
- Last Synced: 2025-10-29T02:56:34.435Z (9 months ago)
- Language: JavaScript
- Size: 1.25 MB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 18
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* book-r Backend
This the backend server for the Lambda School book-r build week project.
** API Documentation
https://lambda-bookr.herokuapp.com/api/
** Local Development
To run the server locally, first install dependencies
#+begin_src sh
yarn install
#+end_src
To run the server for use in another application
#+begin_src sh
yarn frontend
#+end_src
This will reset the development database and fill it with seed data, as well
as launch the server on port 3500. Note that this will discard any existing
data.
To set the server to a different port, set the environment variable ~ENV~ to
the desired number. This can be done using your operating systems method of
choice, or by using a ~.env~ file in the project's root.
For development, the staging postgres database needs to be configured. It's
connection is supplied via the ~DATABASE_URL~ environment variable. To migrate
and seed the database
#+begin_src sh
npx knex migrate:latest --env staging && npx knex seed:run --env staging
#+end_src
To run the server
#+begin_src sh
yarn server
#+end_src
Tests may also be ran via
#+begin_src sh
yarn test-staging
#+end_src
Note that this will rollback and reapply migrations, as well as reseed the database.