Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Pretty-print the JSON output. #13

Merged
merged 1 commit into from

2 participants

@rfk
Owner
rfk commented

This makes it much nicer when hitting the restmail.net REST API by
hand, in a browser.

@rfk rfk Pretty-print the JSON output.
This makes it much nicer when hitting the restmail.net REST API by
hand, in a browser.
282425b
@6a68
Owner

looks great, merging in. @rfk do you know how to deploy to restmail? my key isn't onboard.

@6a68 6a68 merged commit 584c932 into master

1 check passed

Details default The Travis CI build passed
@6a68 6a68 deleted the rfk/pretty-print branch
@6a68
Owner

@rfk as I said in the other issue, I've got keys onboard, and your key is onboard as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 5, 2013
  1. @rfk

    Pretty-print the JSON output.

    rfk authored
    This makes it much nicer when hitting the restmail.net REST API by
    hand, in a browser.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  webserver.js
View
3  webserver.js
@@ -47,7 +47,8 @@ app.get('/mail/:user', function(req, res) {
arr.push(JSON.parse(r));
} catch(e) { }
});
- res.json(arr);
+ res.setHeader("Content-Type", "application/json");
+ res.send(JSON.stringify(arr, undefined, 2));
}
});
});
Something went wrong with that request. Please try again.