You can use the If-Modified-Since header to check if there are any new results since that timestamp. If there are no new results, you'll receive a 304 NOT MODIFIED.
Click the Fork button in the upper right of the screenshot_create-service-account-key
If prompted choose into where you want to form (e.g., if you are a member of multiple github repositories)
You'll now have a forked version - your own version - of the repository.
Go to "Clone or download" button on right of screen and copy that URL. It will be of the format git clone [email protected]:<YOUR OWN GITHUB REPOSITORY>/harvey-api.git
Clone Fork to local box
In the directory on your local box in which you plan to work run: git clone [email protected]:<YOUR OWN GITHUB REPOSITORY>/harvey-api.git
Setting up your .env file
GOOGLE_GEOCODER_API_KEY = Geocoding with Google Maps API, get
one
GOOGLE_MAPS_JS_API_KEY = API key to show gmaps in views. See <script> at end of body in application.html.erb
Can be exactly the same as GOOGLE_GEOCODER_API_KEY
If you see error "Google Maps API error: ApiNotActivatedMapError" in your console, to activate:
click above link to google developer console
In left menu, click "Dashboard"
In header, click "Enable APIs and Services"
Search for "maps", select option for "Google Maps JavaScript API"
In header, click "Enable"
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY = Product Advertising API, see
below
Note: this is optional; currently only needed to fetch new Amazon products from
the Amazon Product Advertising API
You'll need to set the following ENV variables in a .env file
Make a working copy of .env by runng this command at the terminal: cp .env.sample .env
Get Amazon AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from Amazon's IAM. You'll need to create a PolicyName. You can name it "ProductAdvertisingAPI" with the following policy:
You can load Amazon Products by seeding your database: rails db:seed (or doing a full import rails amazon:import)
The ActiveJobs and associated Rake task rails api:import, which imports data for shelters and needs from the production API into the application database, is intended for use in development and test environments only.
DO NOT RUN THIS JOB IN PRODUCTION. Since this job pulls data from the production API, running it in production can only be counter-productive, and would likely be destructive.
Development Process
Tests and Testing
Code should have tests, and any pull requests should be made only after you've made sure passes the test suite
Git and Github use
We force pull-requests from feature branches to master. Once something lands in master, it goes live instantly
Within your own forked repo create branches for each logical unit for work you do. One benefit of doing this is you'll be able to periodically sync your forked repo with upstream repo into the master branch without conflicting with work you may be doing.
Pull Requests
When you believe your code is ready to be merged into the upstream repository (sketch-city/harvey-api) by creating a pull request. Do this by
In github click the "Compare & pull request" button that github will present to you once you've committed changes to local repo
Describe what you changed and why; reference the issue(s) if any that your work addresses
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Postgres is not running OR there is a connection problem to the database.
LICENSE
Software Code
This system's software code is licensed under the GPLv3.
请发表评论