Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rvanasa/wantwords-service
Want, Words! Service?
https://github.com/rvanasa/wantwords-service
Last synced: about 2 months ago
JSON representation
Want, Words! Service?
- Host: GitHub
- URL: https://github.com/rvanasa/wantwords-service
- Owner: rvanasa
- Created: 2020-03-07T09:17:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T04:29:52.000Z (about 2 years ago)
- Last Synced: 2023-03-06T13:00:48.281Z (almost 2 years ago)
- Language: JavaScript
- Size: 1.38 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Want, Words! Service?
A convenient way to get some words that you want.
---
[Production webapp](https://wantwords.herokuapp.com)
[Global lists repository](https://github.com/rvanasa/wantwords)
---
### REST API
`GET /api/lists` - find the keys of all global lists.
`GET /api/random/:key` - choose a random object from the given list.
`GET /api/random/:key/:amount` - generate a bunch of random objects.
`GET /api/source/:key` - retrieve the source code for the given list.
`POST /api/choose` - evaluate the script provided in the request body.
`POST /api/choose/:amount` - evaluate the provided script `:amount` times.
---
### File Format
Below is a quick example of the `.want` file format:
```
# I'm a comment!I'm a string option!
I'm a {reference}!
# Start a local list with key "reference"
{> reference}
# Whitespace is optional
thing
doodad
doohickey# Choose from the global list with namespace "vekta" and key "item_noun"
{vekta:item_noun}# Capitalize result
{^vekta:boss}# Override the global list "vekta:boss_title" with custom strings
{> vekta:boss_title}
Chad-{vekta:boss_modifier}
# Self-reference the top list in this file using {_}
The "{_}"# Start using the "vekta" namespace
{> vekta:}# Add some more boss titles
{> boss_title}
the {person_adj}
# Shorthand for {> vekta:} and {> boss_title}
{>> vekta:boss_title}
# Move into a namespace
{> adj_obj:}
# Override "adj_obj:obj"
{> obj}
Thing
Thang
Thong
# Shorthand: override these keys with the current list and then switch to the last namespace
{! vekta:item_legendary}
{! vekta:item_rare}
{item_common}
```---
### Developer Setup
```sh
git clone https://github.com/rvanasa/wantwords-server
cd wantwords-server
npm install
``````sh
npm run start-dev
```Webapp: http://localhost:3000
API: http://localhost:8080/api/...