This was created during my time as a Code Chrysalis Student
- Added an .Env File. To locally connect to your database, please add a .env file to your workspace root folder.
- USER = "your user name without the quotes"
- PASSWORD = "your password without the quotes"
GET /api/locations
returns JSON data of locations
Table locations
- id
- latitude
- longitude
- site_name
- name
- state
- city
- highway
- type
- highway_exit_num,
- street_address,
- telephone,
- fax
Table amenities
- id
- location_id
- name
Table truck_services
- id
- location_id
- name
Table restaurants
- id
- location_id
- name
If you have a truckstop database created already run the following:
- Enter
psql
in your terminal drop database truckstop;
create database truckstop;
\c truckstop;
SHOW config_file;
will return the path to your config file. Copy the path\q
to exit PostgreSQLvim [PASTE YOUR PATH THAT YOU COPIED]
- Locate
max_connections
in the file and change its value to 500 - Click esc and enter
:wq
brew services restart postgresql
psql
- Enter
SHOW max_connections;
and the value should be changed to 500
- STEPS TO SETTING LOCAL DATABASE (windows users)
- Login to your psql as you usually do, then
\c truckstop
- Once you're there, type
SHOW config_file;
- Copy the path printed when you enter the above command
- Open up a windows explorer, and go to that folder where the config file is (it should end with a .conf)
- Open up with notepad ++ if you have it or notepad
- Locate the term
max_connections
- Change the value from
100
to500
- Restart your computer or restart postgresql
- Log in to your
truckstop database
, and typeSHOW max_connections;
- If you did it right, it should show 500
heroku pg:psql -a cc12-vue-project