name-db
name-db copied to clipboard
Add features to the API
Currently, all the API can do is to search an exact name/alias in the database and return its meaning and translations. We need more features, such as:
- Search (
/search/:term
) - Should return a list of matches by a partial term (Search in both aliases/names) - Get translation (
/:name/:language
) - Should return the translation of:name
in:language
Anything else you can think of :)
You can easily run the API just by cloning the repo and run npm install && npm start
, then you should be able to browse to http://localhost:3000
and see the API is running.
Your clone will connect to the actual production database, however the user supplied there is only able to select
, and is limited by its number of queries per hour.
If you need help or have any ideas, feel free to comment here.
Hello bluzi, I'd like to give this a shot! Would you like /:name/:language to be an ISO 639-3 code or the full name of the language? (ex. "spanish" vs "spa")
Hey @CodeWritingCow, great question :) I'm thinking: Why not both? if the input is 3 letters long, assume it's an ISO code. Otherwise, assume it's a full name of a language
Added search endpoint in #228 :)
I created a proof of concept for the get translation endpoint, then realized someone had already started this in #217. Probably better them than me, I have no idea how Promises work so it was really hacked together. Just putting this here so people know that it's been started and don't spend time working on a duplicate feature.