Skip to content

Instantly share code, notes, and snippets.

@ben-w-smith
Created February 13, 2017 20:42
Show Gist options
  • Save ben-w-smith/efac55c96415158f40e4af1be00c4401 to your computer and use it in GitHub Desktop.
Save ben-w-smith/efac55c96415158f40e4af1be00c4401 to your computer and use it in GitHub Desktop.
var res = {
'status': 'error',
'message': 'No use case for what went wrong'
};
if( !("username" in request.params) ) {
res.message = "No username provided";
}
if( !("password" in request.params) ) {
res.message = "No password provided";
}
if( request.params.username == 'ben'
&& request.params.password == 'pass') {
res.status = 'success';
delete res.message;
res.networks = ['SelectValue', 'SelectCare'];
}
function sendRes() {
response.body = JSON.stringify(res);
}
response.body = JSON.stringify(res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment