Age | Commit message (Collapse) | Author |
|
sendResponse function implements creating and sending a APIRespones so
that this code will not be rewritten for every response situation i.e.
the different http methods.
|
|
Now panics when can't connect to database and splits handling of errors
from Open() and Ping() as separate issues.
|
|
Moves default case (Method Not Allowed) into else clause so it is not
necessary to return from the previous if's --- only for checking http
method, error checking if statements can/should be returning where
needed.
|
|
Access-Control-Allow-Origin:* header added to API responses to allow
angular to access API.
Note: This allows all domains to access this API through browser javascript
See <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS> for a
description of CORS
|
|
|
|
Combines APIResponseItem and APIResponseList into one struct. Hopefully
this allows for the combination of some response code (a function
that sends a APIResponse that can be used by each http method)
|
|
Also adds error for POST to individual resource
|
|
|
|
Changed database schema so ingredients & steps does not have an id, and
therefore can't return it so instead we just exec the insert statement
without returning anything.
We do have to check that there were affected rows in order to accurately
update the recipe object.
|
|
|
|
|
|
|
|
|
|
JSON is no longer output to stdout and actually sent to client
|
|
JSON responses contains a status(error) section and a data section
Note: JSON is still not sent to client
|
|
Note: Still only prints to stdout, does not respond to client
|
|
Note: Only prints recipe to server stdout does not return to client
|
|
|
|
|
|
|