Skip to content

Instantly share code, notes, and snippets.

@hugomd
Last active May 23, 2018 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugomd/f120507ad036ac99479ec2390a54627b to your computer and use it in GitHub Desktop.
Save hugomd/f120507ad036ac99479ec2390a54627b to your computer and use it in GitHub Desktop.
+ const createUser = async username => {
+ try {
+ await axios.post('http://localhost:3001/users', {username});
+ } catch ({message}) {
+ throw new Error(`Failed to create a user, ${message}`);
+ }
+ };
const main = async () => {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment