An application to serve as the backend service for Animal Crossing.
Built as a service that makes API calls to Animal Crossing: New Horizons API
Table of Contents
3.1.1
7.0.4
Postgres 14
To run the application locally, this repository will need to be cloned and set up fully with required gems.
-
Clone the repo:
git@github.com:4D-Coder/amimal-crossing-fish-api.git
-
Install gems:
bundle install
-
To establish the database, run:
rails db:create
If you do not see
Created database 'animal_crossing_fish_api_development'
Run:RAILS_ENV=development rails db:create
-
To migrate the database configurations into your local development and test environment, run:
rails db:migrate
-
To boot up localhost [default port: 3000], run:
rails s
Inspect the /db/schema.rb
and compare to the 'Schema' section below to ensure this migration has been done successfully.
-
This API can be called locally using a program like Postman.
-
Note: Necessary parameters marked with {}
Request URI:
PUT /api/v1/music
Body:
{
"weather":"Sunny"
}
Response:
{
"data": {
"id": "45",
"type": "song",
"attributes": {
"file_name": "BGM_24Hour_14_Sunny",
"hour": 14,
"id": 45,
"music_uri": "https://acnhapi.com/v1/hourly/45",
"weather": "Sunny"
}
}
}
Code | Description |
---|---|
200 | OK |
Notes:
- Will match the song's hour attribute based on the Time.now API's current hour