Releases: benjaminlukeclark/monsternames-api
Containerised Monsternames!
- monsternames-api is now fully containerised! ๐ข
- CircleCI pushes to ECR in my AWS ๐
- ECR images tagged with SHA1 hash of commit for identification ๐
- db vars now read in from env rather than
/etc/config.json
๐ - Behave! behaviour tests added ๐งช
- Logging changed to be using actual log handlers and not print statements โ
- Projects that use this page was not communicate in previous release, so hey that's here ๐
- Removed need for API key in GET requests... shouldn't have been there anyway that was a ๐
What's Changed
- Added projects that use this page by @sudoblark in #11
- Containerisation and Behave! tests by @sudoblark in #13
Full Changelog: v1.1.4...v2.0.0
addNames page and api error messaging
- Added addNames page ๐
- Page allows posting of data to API for users whom are not familiar with programming ๐ค
- Also involves slight changes to api error messages so they make more sense in the frontend ๐
SSL
- Used certbot to get an actually trusted SSL cert for monsternames-api.com ๐ฎ
- Amended static webpages so GET! for API works โ๏ธ
- Updated readme with helpful info about how to replicate this ๐ฆ
Endpoint Consolidation
Its been a while since I've worked on this...
But I had a burst of energy last night that let to quite a significant patch. I completely redone the backend of the flask applicaiton to make it adher to OOP principles ๐ฆ . So now:
- There's no longer an individual .py file for each type of monster ๐ฎ
- Instead there's just one class that's been defined: monster_endpoints. ๐
- This class takes: ๐ฅก
- two peewee.Model or None instances - one for first name and one for last name
- Two booleans indicating if first and last names are present for the endpoint ๐
- The name of the monster we are creating an endpoint for ๐
- The class exposes three public methods, each of which behave differently depending on data provided to the constructor:
- insert_first_name ๐
- insert_last_name ๐
- return_full_name ๐
- Logic to verify users' API keys is now a private method of this endpoint ๐
This doesn't impact users in any way, but makes my job a heck of a lot easier if i want to extend this in the future with more functionality and/or endpoints.
To update to this version:
git pull
git clean -fx
supervisorctl reload
Small web changes
- Changed home page to allow generation of names from all endpoints... the idea being to allow interaction with the api even if you're not a programmer
- Added license file to git repo
- Added CORS headers to goatmen endpoint as this was accidentally left out
- Fixed typos on the website
Website live
- Purchased custom domain for api ๐ธ๏ธ
- Created website for domain, with a home, contribute and endpoints page ๐
- Removed info from readme that is now present on website
- Added (hopefully) helpful content to the website ๐ง
- Added CORS headers to api requests so it works in browsers ๐ฆ
- Added license to repo
First version live with 16 endpoints
Base URL: http://ec2-3-9-54-103.eu-west-2.compute.amazonaws.com
- Version 1 is live!
- 16 juicy endpoints:
endpoint | method | theme |
---|---|---|
/api/v1.0/goatmen | GET | |
/api/v1.0/goatmen/firstName | POST | Cute pet names |
/api/v1.0/goblin | GET | |
/api/v1.0/goblin/firstName | POST | Typical bloke names |
/api/v1.0/goblin/lastName | POST | Typical bloke names |
/api/v1.0/ogre | GET | |
/api/v1.0/ogre/firstName | POST | Dumb sounding cavemen |
/api/v1.0/orc | GET | |
/api/v1.0/orc/firstName | POST | Random nouns |
/api/v1.0/orc/lastName | POST | Negative adjectives |
/api/v1.0/skeleton | GET | |
/api/v1.0/skeleton/firstName | POST | Classy |
/api/v1.0/skeleton/lastName | POST | Classy |
/api/v1.0/troll | GET | |
/api/v1.0/troll/firstName | POST | vaguely Scandinavian |
/api/v1.0/troll/lastName | POST | vaguely Scandinavian |
My good friend Robert Levett-Millett helped massively with thinking of naming schemas and values. Sadly he doesn't have a Github so the only contact link I'll give out will be LinkedIn: https://www.linkedin.com/in/robert-levett-millett/
Between us we've managed to kick the database off with:
- 16 goatmen first names
- 15 goblin first names
- 6 goblin last names
- 10 ogre first names
- 12 orc first names
- 14 orc last names
- 9 skeleton first names
- 6 skeleton last names
- 10 troll first names
- 6 troll last names
Someone far better than me at Maths can probably tell you how many unique entries that is per GET endpoint ๐ฐ
Happy random naming!