Fwew REST API
Currently deployed at tirea.learnnavi.org/api
pre-requisites:
git clone https://github.com/fwew/fwew-api.git
cd fwew-api
go build ./...
edit the included config.json
file with your desired port and web root link.
config.json (defaults):
{
"Port": "10000",
"WebRoot": "http://localhost"
}
simply run the binary resulting from the install step above.
./fwew-api
here is a quick run-down on the endpoints.
/
The root endpoint returns an object containing the endpoints with expected parameters as values.
/fwew/{nav}
{nav}
can be any Na'vi word or words, plain or affixed.
Returns a 2d array of Word objects.
/fwew/r/{lang}/{local}
{lang}
is any one of the following 2-character language codes:
de
(German)en
(English)et
(Estonian)fr
(French)hu
(Hungarian)nl
(Dutch)pl
(Polish)ru
(Russian)sv
(Swedish)
{local}
is any word in the given language, hopefully one that will be found in the dictionary.
Returns an array of Word objects.
/list
Returns an array containing every Word object in the dictionary.
/list/{args}
{args}
is any "what cond spec" string. spaces and all, as usual.
see fwew-lib for more info about list syntax.
Returns an array of Word objects.
/random/{n}
{n}
is any whole number > 0 of random words to retrieve.
Returns an array of Word objects.
/random/{n}/{args}
{n}
is any whole number > 0 of random words to retrieve.
{args}
is any "what cond spec" string. spaces and all, same as with /list/.
see fwew-lib for more info about list syntax.
Returns an array of Word objects.
/number/r/{num}
{num}
is any integer between 0 and 32767 inclusive.
Returns a number entry object.
/number/{word}
{word}
is any Na'vi number spelled out as a word. For example, mevolaw
.
Returns a number entry object.
/lenition
Returns the lenition object.
/version
Returns the version information object.