https://github.com/squat/drae
A RESTful API for el Diccionario de la Real Academia Española
https://github.com/squat/drae
Last synced: over 1 year ago
JSON representation
A RESTful API for el Diccionario de la Real Academia Española
- Host: GitHub
- URL: https://github.com/squat/drae
- Owner: squat
- License: mit
- Created: 2015-07-22T04:48:30.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-02T16:39:35.000Z (over 7 years ago)
- Last Synced: 2024-06-18T23:15:24.517Z (about 2 years ago)
- Language: Go
- Size: 1.65 MB
- Stars: 58
- Watchers: 9
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drae
A RESTful API for el Diccionario de la Real Academia Española
[](https://travis-ci.org/squat/drae) [](https://goreportcard.com/report/github.com/squat/drae) [](https://microbadger.com/images/squat/drae)
## Running
The easiest way to use drae is with the prebuilt container:
```sh
$ docker run -p 4000:4000 squat/drae
```
or if you wish to install drae locally:
```sh
$ go get -u github.com/squat/drae/cmd/drae
```
## Usage
### Define
The `define` command does exactly what you would think: it accepts a string argument and returns a JSON object with the definition for that word.
```sh
$ drae define gato
```
### API
You can run a drae API server from your machine using the `api` command. By default, this server runs on port *4000*, though this can be configured with the `--port` flag.
```sh
$ drae api --port=6969
```
You can now open a browser and query the API at `http://localhost:6969/api/`.
### Endpoints
#### `/api/`
The API has only one endpoint: `/api/`. For example, I could search for the definition of `gato` at `http://localhost:4000/api/gato`.
#### `/healthz`
The `/healthz` endpoint returns a 200 if the API is running.