Simple service using express
This demo loads a page pointing to a node server which has a few simple APIs.
The premise is this is a service that translates error codes into human readable messages. Customer facing error messages shouldn't present too much information that a hacker can infer database, code logic or file structure, but should give enough information that a customer service rep knows how to correct the error or involve tech support.
The database is a simple JSON loaded into memory, will be reset each time the server is restarted. No restrictions on code values.
In the form:
[ { "major":"1","value": [ {"minor":"1","description":"This is major.minor 1.1"}, {"minor":"2","description":"This is major.minor 1.2"} ]}, { "major":"pizza", "value": [ { "minor":"cold", "description":"The pizza is still cold"}, { "minor":"frozen", "description":"Brrrrrr"}, { "minor":"burnt", "description":"Too crisp, even a bit blackened"} ]} ]
This loads a static HTML to use the GET and POST APIs.
Returns all the codes and descriptions
Retruns all the codes and descritpions for a given Major code
Returns a specific code for a given Major.Minor combination
Upsert: will insert a new code or overwrite an existing code.
Removes a code from the database