Add simple way to persist and retrieve settings that aren't environment variables
We store settings in settings/settings.json
Env vars might technically get the job done, but people adjusting them may have to check multiple locations (README, code, etc.) to understand them, and immediate validation is unavailable.
Current settings values can be retrieved all at once using an API endpoint (GET /api/v1/settings)
An individual setting value and be updated as well: (POST /api/v1/settings/:name with JSON body { "value": "string" }). The required format is enforced by the express-validator package; I removed the jet-validator library included with the TypeScript template because it output extremely vague error messages
I also removed the remaining cruft from the TypeScript/Express template I use, including all references to users and authentication, and simplified/clarified naming/comments in a number of other spots.
settings/settings.json
GET /api/v1/settings
)POST /api/v1/settings/:name
with JSON body{ "value": "string" }
). The required format is enforced by theexpress-validator
package; I removed thejet-validator
library included with the TypeScript template because it output extremely vague error messagesI also removed the remaining cruft from the TypeScript/Express template I use, including all references to users and authentication, and simplified/clarified naming/comments in a number of other spots.
Closes #4