<commit_before>
Parse.initialize('myAppId');
Parse.serverURL = 'http://localhost:3000/api';

/*
How to use master key...
var query = new Parse.Query('Messages');
query.count({ useMasterKey=true })


How to use session
var user = req.user;
vr token  = user.getSessionToken();
query.find(sessionToken: token);


*/

Parse.Cloud.define('hello', (req, res) => {
  res.success('boom');
});

Parse.Cloud.define('signUp', (req, res) => {
  try {
    const user = new Parse.User();
    user.set('username', 'nathanvale');
    user.set('password', 'password');

    return user.signUp(null)
      .then(
      response => {
        res.success(response);
      },
      err => {
        console.log(res);
        res.error(err.message);
      });
  } catch (err) {
    return res.error(err.message); // -->  {code: 141, message: "asdf is not defined"}
  }
});

Parse.Cloud.define('logOut', (req, res) => {
  try {
    const user = req.user;
    return user.logOut()
      .then(
      response => {
        res.success(response);
      },
      err => {
        console.log(res);
        res.error(err.message);
      });
  } catch (err) {
    return res.error(err.message); // -->  {code: 141, message: "asdf is not defined"}
  }
});<commit_msg>WIP: implement signup/login/logout on the Parse Cloud<commit_after>
Parse.initialize('myAppId');
Parse.serverURL = 'http://localhost:3000/api';

/*
How to use master key...
var query = new Parse.Query('Messages');
query.count({ useMasterKey=true })


How to use session
var user = req.user;
vr token  = user.getSessionToken();
query.find(sessionToken: token);
*/

Parse.Cloud.define('hello', (req, res) => {
  res.success('Boom!');
});

Parse.Cloud.define('signUp', (req, res) => {
  const user = new Parse.User();
  user.set('username', 'nathanvale2');
  user.set('password', 'password');
  return user.signUp(null)
    .then(
    response => res.success(response),
    err => res.error(err.message)
    );
});

Parse.Cloud.define('logIn', (req, res) =>
  Parse.User.logIn(
    'nathanvale',
    'password'
  )
    .then(
    response => res.success(response),
    err => res.error(err.message))
);

Parse.Cloud.define('logOut', (req, res) =>
  Parse.User.logOut()
    .then(
    response => res.success(response),
    err => res.error(err.message)
    )
);
{'fraction_non_alphanumeric': 0.18997821350762528, 'fraction_numerical': 0.006535947712418301, 'mean_word_length': 3.0351493848857647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6056541', 'n_tokens_mistral': 798, 'n_tokens_neox': 781, 'n_words': 163}