Adds the fetch/index endpoint to all the core models (Topics, Languages and Locations)
Refactors the model Language and its API endpoint to SpokenLanguage to avoid conflicts with Rails internationalization (language seems to be a reserved word)
Add a simple logic for the root / path to show the available API routes if you access the server on your browser in development mode. If it's not development mode, it will redirect to the production site (https://speakher.jp)
Fix and implement tests for the API endpoints
Current available endpoints:
GET / (root) => redirects to production site or shows the API routes on the browser if in dev mode
GET /topics => responds with a JSON with the list of all topics
GET /locations => responds with a JSON with the list of all locations, in ascending order by code
GET /spoken_languages => responds with a JSON with the list of all languages
Issue: https://github.com/WWCodeTokyo/speak-her-db/issues/224 This is a sub-PR to merged to #210 Rails Backend.
This PR implements the following changes:
Language
and its API endpoint toSpokenLanguage
to avoid conflicts with Rails internationalization (language
seems to be a reserved word)/
path to show the available API routes if you access the server on your browser in development mode. If it's not development mode, it will redirect to the production site (https://speakher.jp)Current available endpoints: